@beinformed/ui 1.42.1 → 1.43.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (632) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/esm/builder/index.js.map +1 -1
  3. package/esm/builder/mergeLayoutHintConfigurations.js.map +1 -1
  4. package/esm/constants/Constants.js.map +1 -1
  5. package/esm/constants/LayoutHintConfig.js.map +1 -1
  6. package/esm/constants/LayoutHints.js.map +1 -1
  7. package/esm/constants/Settings.js.map +1 -1
  8. package/esm/constants/index.js.map +1 -1
  9. package/esm/exceptions/ConfigurationException.js.map +1 -1
  10. package/esm/exceptions/FetchException.js.map +1 -1
  11. package/esm/exceptions/IllegalArgumentException.js.map +1 -1
  12. package/esm/exceptions/IllegalReturnException.js.map +1 -1
  13. package/esm/exceptions/IllegalStateException.js.map +1 -1
  14. package/esm/exceptions/JsonParseException.js.map +1 -1
  15. package/esm/exceptions/MissingPropertyException.js.map +1 -1
  16. package/esm/exceptions/NetworkException.js.map +1 -1
  17. package/esm/exceptions/NotAllowedUriException.js.map +1 -1
  18. package/esm/exceptions/NotFoundException.js.map +1 -1
  19. package/esm/exceptions/ServerRequestException.js.map +1 -1
  20. package/esm/exceptions/ThemePropertyException.js.map +1 -1
  21. package/esm/exceptions/TimeoutException.js.map +1 -1
  22. package/esm/exceptions/UnauthorizedException.js.map +1 -1
  23. package/esm/exceptions/UnsupportedOperationException.js.map +1 -1
  24. package/esm/exceptions/index.js.map +1 -1
  25. package/esm/hooks/index.js.map +1 -1
  26. package/esm/hooks/useAllFormsOnModel.js.map +1 -1
  27. package/esm/hooks/useAuthentication.js.map +1 -1
  28. package/esm/hooks/useContent.js.map +1 -1
  29. package/esm/hooks/useDeepCompareEffect.js.map +1 -1
  30. package/esm/hooks/useForm.js.map +1 -1
  31. package/esm/hooks/useI18n.js.map +1 -1
  32. package/esm/hooks/useModal.js.map +1 -1
  33. package/esm/hooks/useModelCatalog.js +19 -23
  34. package/esm/hooks/useModelCatalog.js.map +1 -1
  35. package/esm/hooks/useModels.js +15 -1
  36. package/esm/hooks/useModels.js.map +1 -1
  37. package/esm/hooks/useModularUI.js.map +1 -1
  38. package/esm/hooks/useModularUIBasic.js.map +1 -1
  39. package/esm/hooks/useModularUIModel.js.map +1 -1
  40. package/esm/hooks/useModularUIRequest.js.map +1 -1
  41. package/esm/hooks/useNotification.js.map +1 -1
  42. package/esm/hooks/usePreference.js.map +1 -1
  43. package/esm/hooks/useProgressIndicator.js.map +1 -1
  44. package/esm/hooks/useRouter.js.map +1 -1
  45. package/esm/i18n/Locale.js.map +1 -1
  46. package/esm/i18n/Locales.js.map +1 -1
  47. package/esm/i18n/Message.js.map +1 -1
  48. package/esm/i18n/index.js.map +1 -1
  49. package/esm/i18n/languages.js.map +1 -1
  50. package/esm/i18n/translations/beinformed_error_messages_en.nl.js.map +1 -1
  51. package/esm/i18n/translations/beinformed_error_messages_nl.nl.js.map +1 -1
  52. package/esm/i18n/types.js.map +1 -1
  53. package/esm/i18n/withMessage.js.map +1 -1
  54. package/esm/index.js.map +1 -1
  55. package/esm/models/actions/ActionCollection.js.map +1 -1
  56. package/esm/models/actions/ActionModel.js.map +1 -1
  57. package/esm/models/application/ApplicationModel.js.map +1 -1
  58. package/esm/models/attributes/AttributeCollection.js.map +1 -1
  59. package/esm/models/attributes/AttributeContent.js.map +1 -1
  60. package/esm/models/attributes/AttributeDataHelper.js.map +1 -1
  61. package/esm/models/attributes/AttributeModel.js.map +1 -1
  62. package/esm/models/attributes/AttributeSetModel.js.map +1 -1
  63. package/esm/models/attributes/BooleanAttributeModel.js.map +1 -1
  64. package/esm/models/attributes/CaptchaAttributeModel.js.map +1 -1
  65. package/esm/models/attributes/ChoiceAttributeModel.js.map +1 -1
  66. package/esm/models/attributes/ChoiceAttributeOptionCollection.js.map +1 -1
  67. package/esm/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
  68. package/esm/models/attributes/CompositeAttributeChildCollection.js.map +1 -1
  69. package/esm/models/attributes/CompositeAttributeModel.js.map +1 -1
  70. package/esm/models/attributes/DatetimeAttributeModel.js.map +1 -1
  71. package/esm/models/attributes/HelptextAttributeModel.js.map +1 -1
  72. package/esm/models/attributes/LabelAttributeModel.js.map +1 -1
  73. package/esm/models/attributes/MemoAttributeModel.js.map +1 -1
  74. package/esm/models/attributes/MoneyAttributeModel.js.map +1 -1
  75. package/esm/models/attributes/NumberAttributeModel.js.map +1 -1
  76. package/esm/models/attributes/PasswordAttributeModel.js.map +1 -1
  77. package/esm/models/attributes/StringAttributeModel.js.map +1 -1
  78. package/esm/models/attributes/UploadAttributeModel.js.map +1 -1
  79. package/esm/models/attributes/XMLAttributeModel.js.map +1 -1
  80. package/esm/models/attributes/_createAttribute.js.map +1 -1
  81. package/esm/models/attributes/input-constraints/BSNConstraint.js.map +1 -1
  82. package/esm/models/attributes/input-constraints/ConstraintCollection.js.map +1 -1
  83. package/esm/models/attributes/input-constraints/ConstraintModel.js.map +1 -1
  84. package/esm/models/attributes/input-constraints/DateBoundaryConstraint.js.map +1 -1
  85. package/esm/models/attributes/input-constraints/DateTimeDateFormatConstraint.js.map +1 -1
  86. package/esm/models/attributes/input-constraints/DateTimeTimeFormatConstraint.js.map +1 -1
  87. package/esm/models/attributes/input-constraints/DatetimeFormatConstraint.js.map +1 -1
  88. package/esm/models/attributes/input-constraints/FileExtensionConstraint.js.map +1 -1
  89. package/esm/models/attributes/input-constraints/FileSizeConstraint.js.map +1 -1
  90. package/esm/models/attributes/input-constraints/IBANConstraint.js.map +1 -1
  91. package/esm/models/attributes/input-constraints/MandatoryConstraint.js.map +1 -1
  92. package/esm/models/attributes/input-constraints/MandatoryRangeConstraint.js.map +1 -1
  93. package/esm/models/attributes/input-constraints/NumberBoundaryConstraint.js.map +1 -1
  94. package/esm/models/attributes/input-constraints/NumberFormatConstraint.js.map +1 -1
  95. package/esm/models/attributes/input-constraints/NumberGroupingConstraint.js.map +1 -1
  96. package/esm/models/attributes/input-constraints/PasswordConfirmConstraint.js.map +1 -1
  97. package/esm/models/attributes/input-constraints/PasswordLowerAndUpperCaseConstraint.js.map +1 -1
  98. package/esm/models/attributes/input-constraints/PasswordMinNumericCharactersConstraint.js.map +1 -1
  99. package/esm/models/attributes/input-constraints/PasswordMinSpecialCharactersConstraint.js.map +1 -1
  100. package/esm/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js.map +1 -1
  101. package/esm/models/attributes/input-constraints/RangeConstraint.js.map +1 -1
  102. package/esm/models/attributes/input-constraints/RegexConstraint.js.map +1 -1
  103. package/esm/models/attributes/input-constraints/StringLengthConstraint.js.map +1 -1
  104. package/esm/models/attributes/input-constraints/XMLConstraint.js.map +1 -1
  105. package/esm/models/attributes/layouthint-rules/BaseLayoutHintRule.js.map +1 -1
  106. package/esm/models/attributes/layouthint-rules/DependentAttribute.js.map +1 -1
  107. package/esm/models/attributes/layouthint-rules/LayoutHintRuleCollection.js.map +1 -1
  108. package/esm/models/attributes/layouthint-rules/RemainingTotalUploadSize.js.map +1 -1
  109. package/esm/models/base/BaseCollection.js.map +1 -1
  110. package/esm/models/base/BaseModel.js.map +1 -1
  111. package/esm/models/base/ResourceCollection.js.map +1 -1
  112. package/esm/models/base/ResourceModel.js.map +1 -1
  113. package/esm/models/caseview/CaseViewModel.js.map +1 -1
  114. package/esm/models/concepts/BusinessScenarioModel.js.map +1 -1
  115. package/esm/models/concepts/ConceptDetailModel.js.map +1 -1
  116. package/esm/models/concepts/ConceptIndexModel.js.map +1 -1
  117. package/esm/models/concepts/ConceptLinkModel.js.map +1 -1
  118. package/esm/models/concepts/ConceptRelationCollection.js.map +1 -1
  119. package/esm/models/concepts/ConceptRelationModel.js.map +1 -1
  120. package/esm/models/concepts/ConceptTypeDetailModel.js.map +1 -1
  121. package/esm/models/concepts/SourceReferenceCollection.js.map +1 -1
  122. package/esm/models/concepts/SourceReferenceModel.js.map +1 -1
  123. package/esm/models/content/ContentIndexModel.js.map +1 -1
  124. package/esm/models/content/ContentLinkModel.js.map +1 -1
  125. package/esm/models/content/ContentModel.js.map +1 -1
  126. package/esm/models/content/ContentTOCModel.js.map +1 -1
  127. package/esm/models/content/ContentTypeModel.js.map +1 -1
  128. package/esm/models/content/SectionModel.js.map +1 -1
  129. package/esm/models/content/SubSectionModel.js.map +1 -1
  130. package/esm/models/contentconfiguration/ContentConfiguration.js.map +1 -1
  131. package/esm/models/contentconfiguration/ContentConfigurationElements.js.map +1 -1
  132. package/esm/models/contentconfiguration/ContentConfigurationEndResults.js.map +1 -1
  133. package/esm/models/contentconfiguration/ContentConfigurationQuestions.js.map +1 -1
  134. package/esm/models/contentconfiguration/ContentConfigurationResults.js.map +1 -1
  135. package/esm/models/detail/DetailModel.js.map +1 -1
  136. package/esm/models/error/ErrorCollection.js.map +1 -1
  137. package/esm/models/error/ErrorModel.js.map +1 -1
  138. package/esm/models/error/ErrorResponse.js.map +1 -1
  139. package/esm/models/filters/AssignmentFilterModel.js.map +1 -1
  140. package/esm/models/filters/BaseFilterModel.js.map +1 -1
  141. package/esm/models/filters/ConceptIndexFilterModel.js.map +1 -1
  142. package/esm/models/filters/FilterCollection.js.map +1 -1
  143. package/esm/models/filters/FilterModel.js.map +1 -1
  144. package/esm/models/filters/RangeFilterModel.js.map +1 -1
  145. package/esm/models/filters/StringFilterModel.js.map +1 -1
  146. package/esm/models/form/FormModel.js.map +1 -1
  147. package/esm/models/form/FormObjectModel.js.map +1 -1
  148. package/esm/models/grouping/GroupingModel.js.map +1 -1
  149. package/esm/models/href/Href.js.map +1 -1
  150. package/esm/models/href/ListHref.js.map +1 -1
  151. package/esm/models/index.js.map +1 -1
  152. package/esm/models/layouthint/LayoutHintCollection.js.map +1 -1
  153. package/esm/models/links/LinkCollection.js.map +1 -1
  154. package/esm/models/links/LinkModel.js.map +1 -1
  155. package/esm/models/links/normalizeLinkJSON.js.map +1 -1
  156. package/esm/models/list/ListDetailModel.js.map +1 -1
  157. package/esm/models/list/ListHeaderModel.js.map +1 -1
  158. package/esm/models/list/ListItemCollection.js.map +1 -1
  159. package/esm/models/list/ListItemModel.js.map +1 -1
  160. package/esm/models/list/ListModel.js.map +1 -1
  161. package/esm/models/lookup/LookupOptionCollection.js.map +1 -1
  162. package/esm/models/lookup/LookupOptionsModel.js.map +1 -1
  163. package/esm/models/modelcatalog/ModelCatalogModel.js.map +1 -1
  164. package/esm/models/paging/PagesizeModel.js.map +1 -1
  165. package/esm/models/paging/PagingModel.js.map +1 -1
  166. package/esm/models/panels/GroupingPanelModel.js.map +1 -1
  167. package/esm/models/parameter/Parameter.js.map +1 -1
  168. package/esm/models/process/ProcessStatusSettingsModel.js.map +1 -1
  169. package/esm/models/resolveModel.js.map +1 -1
  170. package/esm/models/search/CaseSearchModel.js.map +1 -1
  171. package/esm/models/sorting/SortOptionModel.js.map +1 -1
  172. package/esm/models/sorting/SortingModel.js.map +1 -1
  173. package/esm/models/tab/TabModel.js.map +1 -1
  174. package/esm/models/taskgroup/TaskGroupCollection.js.map +1 -1
  175. package/esm/models/taskgroup/TaskGroupModel.js.map +1 -1
  176. package/esm/models/types.js.map +1 -1
  177. package/esm/models/user/UserModel.js.map +1 -1
  178. package/esm/models/user/UserProfileModel.js.map +1 -1
  179. package/esm/models/user/UserServicesModel.js.map +1 -1
  180. package/esm/modularui/Authenticate.js.map +1 -1
  181. package/esm/modularui/CaptchaRequest.js.map +1 -1
  182. package/esm/modularui/ModularUIError.js.map +1 -1
  183. package/esm/modularui/ModularUIRequest.js.map +1 -1
  184. package/esm/modularui/ModularUIResponse.js.map +1 -1
  185. package/esm/modularui/UploadRequest.js.map +1 -1
  186. package/esm/modularui/index.js.map +1 -1
  187. package/esm/modularui/types.js.map +1 -1
  188. package/esm/react/ErrorBoundary.js.map +1 -1
  189. package/esm/react/ErrorBoundaryFallback.js.map +1 -1
  190. package/esm/react/index.js.map +1 -1
  191. package/esm/react/utils.js.map +1 -1
  192. package/esm/react-client/Init.js.map +1 -1
  193. package/esm/react-client/client.js.map +1 -1
  194. package/esm/react-client/contextPath.js.map +1 -1
  195. package/esm/react-client/index.js.map +1 -1
  196. package/esm/react-client/rehydrate.js.map +1 -1
  197. package/esm/react-server/contextPath.js.map +1 -1
  198. package/esm/react-server/createSSRComplete.js.map +1 -1
  199. package/esm/react-server/htmlpage.js.map +1 -1
  200. package/esm/react-server/index.js.map +1 -1
  201. package/esm/react-server/renderSSRComplete.js.map +1 -1
  202. package/esm/react-server/renderSSRMinimal.js.map +1 -1
  203. package/esm/react-server/requestInformation.js.map +1 -1
  204. package/esm/react-server/serverNoSSR.js.map +1 -1
  205. package/esm/react-server/serverSSR.js.map +1 -1
  206. package/esm/react-server/serverUtil.js.map +1 -1
  207. package/esm/react-theme/ThemeProvider.js.map +1 -1
  208. package/esm/react-theme/createTheme.js.map +1 -1
  209. package/esm/react-theme/index.js.map +1 -1
  210. package/esm/react-theme/types.js.map +1 -1
  211. package/esm/react-theme/useTheme.js.map +1 -1
  212. package/esm/react-theme/utils/background.js.map +1 -1
  213. package/esm/react-theme/utils/colors.js.map +1 -1
  214. package/esm/react-theme/utils/contrast.js.map +1 -1
  215. package/esm/react-theme/utils/corners.js.map +1 -1
  216. package/esm/react-theme/utils/spacers.js.map +1 -1
  217. package/esm/react-theme/utils/themeProps.js.map +1 -1
  218. package/esm/redux/_i18n/I18nActions.js.map +1 -1
  219. package/esm/redux/_i18n/I18nReducer.js.map +1 -1
  220. package/esm/redux/_i18n/index.js.map +1 -1
  221. package/esm/redux/_i18n/types.js.map +1 -1
  222. package/esm/redux/_modularui/ModularUIActions.js.map +1 -1
  223. package/esm/redux/_modularui/ModularUIConnector.js.map +1 -1
  224. package/esm/redux/_modularui/ModularUIMiddleware.js.map +1 -1
  225. package/esm/redux/_modularui/ModularUIReducer.js.map +1 -1
  226. package/esm/redux/_modularui/ModularUISelectors.js.map +1 -1
  227. package/esm/redux/_modularui/ModularUIUtils.js.map +1 -1
  228. package/esm/redux/_modularui/index.js.map +1 -1
  229. package/esm/redux/_modularui/types.js.map +1 -1
  230. package/esm/redux/_modularui/withModularUI.js.map +1 -1
  231. package/esm/redux/_router/RouterActions.js.map +1 -1
  232. package/esm/redux/_router/RouterConnectors.js.map +1 -1
  233. package/esm/redux/_router/RouterMiddleware.js.map +1 -1
  234. package/esm/redux/_router/RouterReducer.js.map +1 -1
  235. package/esm/redux/_router/index.js.map +1 -1
  236. package/esm/redux/_router/types.js.map +1 -1
  237. package/esm/redux/actions/Application.js.map +1 -1
  238. package/esm/redux/actions/Authorization.js.map +1 -1
  239. package/esm/redux/actions/Error.js.map +1 -1
  240. package/esm/redux/actions/Form.js.map +1 -1
  241. package/esm/redux/actions/FormAttributeSet.js.map +1 -1
  242. package/esm/redux/actions/FormAttributeSetRepeatable.js.map +1 -1
  243. package/esm/redux/actions/FormAutosave.js.map +1 -1
  244. package/esm/redux/actions/FormAutosubmit.js.map +1 -1
  245. package/esm/redux/actions/FormValidations.js.map +1 -1
  246. package/esm/redux/actions/Modals.js.map +1 -1
  247. package/esm/redux/actions/Notification.js.map +1 -1
  248. package/esm/redux/actions/Preferences.js.map +1 -1
  249. package/esm/redux/actions/ProgressIndicator.js.map +1 -1
  250. package/esm/redux/actions/SignIn.js.map +1 -1
  251. package/esm/redux/actions/SignOut.js.map +1 -1
  252. package/esm/redux/actions/index.js.map +1 -1
  253. package/esm/redux/connectors/Application.js.map +1 -1
  254. package/esm/redux/connectors/Breadcrumb.js.map +1 -1
  255. package/esm/redux/connectors/CaseView.js.map +1 -1
  256. package/esm/redux/connectors/ConceptDetail.js.map +1 -1
  257. package/esm/redux/connectors/ContentBrowser.js.map +1 -1
  258. package/esm/redux/connectors/ContentDetail.js.map +1 -1
  259. package/esm/redux/connectors/ContentDetailSection.js.map +1 -1
  260. package/esm/redux/connectors/Form.js.map +1 -1
  261. package/esm/redux/connectors/FormAttributeSet.js.map +1 -1
  262. package/esm/redux/connectors/ListDetail.js.map +1 -1
  263. package/esm/redux/connectors/Modal.js.map +1 -1
  264. package/esm/redux/connectors/ModelCatalog.js.map +1 -1
  265. package/esm/redux/connectors/Notification.js.map +1 -1
  266. package/esm/redux/connectors/PanelRenderer.js.map +1 -1
  267. package/esm/redux/connectors/Preferences.js.map +1 -1
  268. package/esm/redux/connectors/Progress.js.map +1 -1
  269. package/esm/redux/connectors/ProgressIndicator.js.map +1 -1
  270. package/esm/redux/connectors/QuickSearch.js.map +1 -1
  271. package/esm/redux/connectors/SignIn.js.map +1 -1
  272. package/esm/redux/connectors/SignOut.js.map +1 -1
  273. package/esm/redux/connectors/Tab.js.map +1 -1
  274. package/esm/redux/connectors/index.js.map +1 -1
  275. package/esm/redux/index.js.map +1 -1
  276. package/esm/redux/reducers/AuthReducer.js.map +1 -1
  277. package/esm/redux/reducers/ErrorReducer.js.map +1 -1
  278. package/esm/redux/reducers/ModalsReducer.js.map +1 -1
  279. package/esm/redux/reducers/NotificationReducer.js.map +1 -1
  280. package/esm/redux/reducers/PreferencesReducer.js.map +1 -1
  281. package/esm/redux/reducers/ProgressIndicatorReducer.js.map +1 -1
  282. package/esm/redux/reducers/createReducer.js.map +1 -1
  283. package/esm/redux/reducers/index.js.map +1 -1
  284. package/esm/redux/selectors/i18n.js.map +1 -1
  285. package/esm/redux/selectors/index.js.map +1 -1
  286. package/esm/redux/store/beforeRenderHooks.js.map +1 -1
  287. package/esm/redux/store/configureStore.js.map +1 -1
  288. package/esm/redux/types.js.map +1 -1
  289. package/esm/utils/browser/Cache.js.map +1 -1
  290. package/esm/utils/browser/Cookies.js.map +1 -1
  291. package/esm/utils/datetime/DateTimeUtil.js.map +1 -1
  292. package/esm/utils/fetch/serverFetch.js.map +1 -1
  293. package/esm/utils/fetch/types.js.map +1 -1
  294. package/esm/utils/fetch/universalFetch.js.map +1 -1
  295. package/esm/utils/fetch/xhr.js.map +1 -1
  296. package/esm/utils/helpers/checkResource.js.map +1 -1
  297. package/esm/utils/helpers/createHash.js.map +1 -1
  298. package/esm/utils/helpers/createHref.js +68 -0
  299. package/esm/utils/helpers/createHref.js.map +1 -0
  300. package/esm/utils/helpers/createUUID.js.map +1 -1
  301. package/esm/utils/helpers/index.js +1 -0
  302. package/esm/utils/helpers/index.js.map +1 -1
  303. package/esm/utils/helpers/objects.js.map +1 -1
  304. package/esm/utils/helpers/repositoryResource.js.map +1 -1
  305. package/esm/utils/helpers/sanitizeHtml.js.map +1 -1
  306. package/esm/utils/helpers/text.js.map +1 -1
  307. package/esm/utils/index.js.map +1 -1
  308. package/esm/utils/number/DecimalFormat.js.map +1 -1
  309. package/esm/utils/number/formatValue.js.map +1 -1
  310. package/esm/utils/number/parseNumbers.js.map +1 -1
  311. package/lib/builder/index.js.map +1 -1
  312. package/lib/builder/mergeLayoutHintConfigurations.js.map +1 -1
  313. package/lib/constants/Constants.js.map +1 -1
  314. package/lib/constants/LayoutHintConfig.js.map +1 -1
  315. package/lib/constants/LayoutHints.js.map +1 -1
  316. package/lib/constants/Settings.js.map +1 -1
  317. package/lib/constants/index.js.map +1 -1
  318. package/lib/exceptions/ConfigurationException.js.map +1 -1
  319. package/lib/exceptions/FetchException.js.map +1 -1
  320. package/lib/exceptions/IllegalArgumentException.js.map +1 -1
  321. package/lib/exceptions/IllegalReturnException.js.map +1 -1
  322. package/lib/exceptions/IllegalStateException.js.map +1 -1
  323. package/lib/exceptions/JsonParseException.js.map +1 -1
  324. package/lib/exceptions/MissingPropertyException.js.map +1 -1
  325. package/lib/exceptions/NetworkException.js.map +1 -1
  326. package/lib/exceptions/NotAllowedUriException.js.map +1 -1
  327. package/lib/exceptions/NotFoundException.js.map +1 -1
  328. package/lib/exceptions/ServerRequestException.js.map +1 -1
  329. package/lib/exceptions/ThemePropertyException.js.map +1 -1
  330. package/lib/exceptions/TimeoutException.js.map +1 -1
  331. package/lib/exceptions/UnauthorizedException.js.map +1 -1
  332. package/lib/exceptions/UnsupportedOperationException.js.map +1 -1
  333. package/lib/exceptions/index.js.map +1 -1
  334. package/lib/hooks/__tests__/useModels.spec.js.flow +96 -1
  335. package/lib/hooks/index.js.map +1 -1
  336. package/lib/hooks/useAllFormsOnModel.js.map +1 -1
  337. package/lib/hooks/useAuthentication.js.map +1 -1
  338. package/lib/hooks/useContent.js.map +1 -1
  339. package/lib/hooks/useDeepCompareEffect.js.map +1 -1
  340. package/lib/hooks/useForm.js.map +1 -1
  341. package/lib/hooks/useI18n.js.map +1 -1
  342. package/lib/hooks/useModal.js.map +1 -1
  343. package/lib/hooks/useModelCatalog.js +19 -24
  344. package/lib/hooks/useModelCatalog.js.flow +13 -23
  345. package/lib/hooks/useModelCatalog.js.map +1 -1
  346. package/lib/hooks/useModels.js +15 -0
  347. package/lib/hooks/useModels.js.flow +17 -1
  348. package/lib/hooks/useModels.js.map +1 -1
  349. package/lib/hooks/useModularUI.js.map +1 -1
  350. package/lib/hooks/useModularUIBasic.js.map +1 -1
  351. package/lib/hooks/useModularUIModel.js.map +1 -1
  352. package/lib/hooks/useModularUIRequest.js.map +1 -1
  353. package/lib/hooks/useNotification.js.map +1 -1
  354. package/lib/hooks/usePreference.js.map +1 -1
  355. package/lib/hooks/useProgressIndicator.js.map +1 -1
  356. package/lib/hooks/useRouter.js.map +1 -1
  357. package/lib/i18n/Locale.js.map +1 -1
  358. package/lib/i18n/Locales.js.map +1 -1
  359. package/lib/i18n/Message.js.map +1 -1
  360. package/lib/i18n/index.js.map +1 -1
  361. package/lib/i18n/languages.js.map +1 -1
  362. package/lib/i18n/translations/beinformed_error_messages_en.nl.js.map +1 -1
  363. package/lib/i18n/translations/beinformed_error_messages_nl.nl.js.map +1 -1
  364. package/lib/i18n/types.js.map +1 -1
  365. package/lib/i18n/withMessage.js.map +1 -1
  366. package/lib/index.js.map +1 -1
  367. package/lib/models/actions/ActionCollection.js.map +1 -1
  368. package/lib/models/actions/ActionModel.js.map +1 -1
  369. package/lib/models/application/ApplicationModel.js.map +1 -1
  370. package/lib/models/attributes/AttributeCollection.js.map +1 -1
  371. package/lib/models/attributes/AttributeContent.js.map +1 -1
  372. package/lib/models/attributes/AttributeDataHelper.js.map +1 -1
  373. package/lib/models/attributes/AttributeModel.js.map +1 -1
  374. package/lib/models/attributes/AttributeSetModel.js.map +1 -1
  375. package/lib/models/attributes/BooleanAttributeModel.js.map +1 -1
  376. package/lib/models/attributes/CaptchaAttributeModel.js.map +1 -1
  377. package/lib/models/attributes/ChoiceAttributeModel.js.map +1 -1
  378. package/lib/models/attributes/ChoiceAttributeOptionCollection.js.map +1 -1
  379. package/lib/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
  380. package/lib/models/attributes/CompositeAttributeChildCollection.js.map +1 -1
  381. package/lib/models/attributes/CompositeAttributeModel.js.map +1 -1
  382. package/lib/models/attributes/DatetimeAttributeModel.js.map +1 -1
  383. package/lib/models/attributes/HelptextAttributeModel.js.map +1 -1
  384. package/lib/models/attributes/LabelAttributeModel.js.map +1 -1
  385. package/lib/models/attributes/MemoAttributeModel.js.map +1 -1
  386. package/lib/models/attributes/MoneyAttributeModel.js.map +1 -1
  387. package/lib/models/attributes/NumberAttributeModel.js.map +1 -1
  388. package/lib/models/attributes/PasswordAttributeModel.js.map +1 -1
  389. package/lib/models/attributes/StringAttributeModel.js.map +1 -1
  390. package/lib/models/attributes/UploadAttributeModel.js.map +1 -1
  391. package/lib/models/attributes/XMLAttributeModel.js.map +1 -1
  392. package/lib/models/attributes/_createAttribute.js.map +1 -1
  393. package/lib/models/attributes/input-constraints/BSNConstraint.js.map +1 -1
  394. package/lib/models/attributes/input-constraints/ConstraintCollection.js.map +1 -1
  395. package/lib/models/attributes/input-constraints/ConstraintModel.js.map +1 -1
  396. package/lib/models/attributes/input-constraints/DateBoundaryConstraint.js.map +1 -1
  397. package/lib/models/attributes/input-constraints/DateTimeDateFormatConstraint.js.map +1 -1
  398. package/lib/models/attributes/input-constraints/DateTimeTimeFormatConstraint.js.map +1 -1
  399. package/lib/models/attributes/input-constraints/DatetimeFormatConstraint.js.map +1 -1
  400. package/lib/models/attributes/input-constraints/FileExtensionConstraint.js.map +1 -1
  401. package/lib/models/attributes/input-constraints/FileSizeConstraint.js.map +1 -1
  402. package/lib/models/attributes/input-constraints/IBANConstraint.js.map +1 -1
  403. package/lib/models/attributes/input-constraints/MandatoryConstraint.js.map +1 -1
  404. package/lib/models/attributes/input-constraints/MandatoryRangeConstraint.js.map +1 -1
  405. package/lib/models/attributes/input-constraints/NumberBoundaryConstraint.js.map +1 -1
  406. package/lib/models/attributes/input-constraints/NumberFormatConstraint.js.map +1 -1
  407. package/lib/models/attributes/input-constraints/NumberGroupingConstraint.js.map +1 -1
  408. package/lib/models/attributes/input-constraints/PasswordConfirmConstraint.js.map +1 -1
  409. package/lib/models/attributes/input-constraints/PasswordLowerAndUpperCaseConstraint.js.map +1 -1
  410. package/lib/models/attributes/input-constraints/PasswordMinNumericCharactersConstraint.js.map +1 -1
  411. package/lib/models/attributes/input-constraints/PasswordMinSpecialCharactersConstraint.js.map +1 -1
  412. package/lib/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js.map +1 -1
  413. package/lib/models/attributes/input-constraints/RangeConstraint.js.map +1 -1
  414. package/lib/models/attributes/input-constraints/RegexConstraint.js.map +1 -1
  415. package/lib/models/attributes/input-constraints/StringLengthConstraint.js.map +1 -1
  416. package/lib/models/attributes/input-constraints/XMLConstraint.js.map +1 -1
  417. package/lib/models/attributes/layouthint-rules/BaseLayoutHintRule.js.map +1 -1
  418. package/lib/models/attributes/layouthint-rules/DependentAttribute.js.map +1 -1
  419. package/lib/models/attributes/layouthint-rules/LayoutHintRuleCollection.js.map +1 -1
  420. package/lib/models/attributes/layouthint-rules/RemainingTotalUploadSize.js.map +1 -1
  421. package/lib/models/base/BaseCollection.js.map +1 -1
  422. package/lib/models/base/BaseModel.js.map +1 -1
  423. package/lib/models/base/ResourceCollection.js.map +1 -1
  424. package/lib/models/base/ResourceModel.js.map +1 -1
  425. package/lib/models/caseview/CaseViewModel.js.map +1 -1
  426. package/lib/models/concepts/BusinessScenarioModel.js.map +1 -1
  427. package/lib/models/concepts/ConceptDetailModel.js.map +1 -1
  428. package/lib/models/concepts/ConceptIndexModel.js.map +1 -1
  429. package/lib/models/concepts/ConceptLinkModel.js.map +1 -1
  430. package/lib/models/concepts/ConceptRelationCollection.js.map +1 -1
  431. package/lib/models/concepts/ConceptRelationModel.js.map +1 -1
  432. package/lib/models/concepts/ConceptTypeDetailModel.js.map +1 -1
  433. package/lib/models/concepts/SourceReferenceCollection.js.map +1 -1
  434. package/lib/models/concepts/SourceReferenceModel.js.map +1 -1
  435. package/lib/models/content/ContentIndexModel.js.map +1 -1
  436. package/lib/models/content/ContentLinkModel.js.map +1 -1
  437. package/lib/models/content/ContentModel.js.map +1 -1
  438. package/lib/models/content/ContentTOCModel.js.map +1 -1
  439. package/lib/models/content/ContentTypeModel.js.map +1 -1
  440. package/lib/models/content/SectionModel.js.map +1 -1
  441. package/lib/models/content/SubSectionModel.js.map +1 -1
  442. package/lib/models/contentconfiguration/ContentConfiguration.js.map +1 -1
  443. package/lib/models/contentconfiguration/ContentConfigurationElements.js.map +1 -1
  444. package/lib/models/contentconfiguration/ContentConfigurationEndResults.js.map +1 -1
  445. package/lib/models/contentconfiguration/ContentConfigurationQuestions.js.map +1 -1
  446. package/lib/models/contentconfiguration/ContentConfigurationResults.js.map +1 -1
  447. package/lib/models/detail/DetailModel.js.map +1 -1
  448. package/lib/models/error/ErrorCollection.js.map +1 -1
  449. package/lib/models/error/ErrorModel.js.map +1 -1
  450. package/lib/models/error/ErrorResponse.js.map +1 -1
  451. package/lib/models/filters/AssignmentFilterModel.js.map +1 -1
  452. package/lib/models/filters/BaseFilterModel.js.map +1 -1
  453. package/lib/models/filters/ConceptIndexFilterModel.js.map +1 -1
  454. package/lib/models/filters/FilterCollection.js.map +1 -1
  455. package/lib/models/filters/FilterModel.js.map +1 -1
  456. package/lib/models/filters/RangeFilterModel.js.map +1 -1
  457. package/lib/models/filters/StringFilterModel.js.map +1 -1
  458. package/lib/models/form/FormModel.js.map +1 -1
  459. package/lib/models/form/FormObjectModel.js.map +1 -1
  460. package/lib/models/grouping/GroupingModel.js.map +1 -1
  461. package/lib/models/href/Href.js.map +1 -1
  462. package/lib/models/href/ListHref.js.map +1 -1
  463. package/lib/models/index.js.map +1 -1
  464. package/lib/models/layouthint/LayoutHintCollection.js.map +1 -1
  465. package/lib/models/links/LinkCollection.js.map +1 -1
  466. package/lib/models/links/LinkModel.js.map +1 -1
  467. package/lib/models/links/normalizeLinkJSON.js.map +1 -1
  468. package/lib/models/list/ListDetailModel.js.map +1 -1
  469. package/lib/models/list/ListHeaderModel.js.map +1 -1
  470. package/lib/models/list/ListItemCollection.js.map +1 -1
  471. package/lib/models/list/ListItemModel.js.map +1 -1
  472. package/lib/models/list/ListModel.js.map +1 -1
  473. package/lib/models/lookup/LookupOptionCollection.js.map +1 -1
  474. package/lib/models/lookup/LookupOptionsModel.js.map +1 -1
  475. package/lib/models/modelcatalog/ModelCatalogModel.js.map +1 -1
  476. package/lib/models/paging/PagesizeModel.js.map +1 -1
  477. package/lib/models/paging/PagingModel.js.map +1 -1
  478. package/lib/models/panels/GroupingPanelModel.js.map +1 -1
  479. package/lib/models/parameter/Parameter.js.map +1 -1
  480. package/lib/models/process/ProcessStatusSettingsModel.js.map +1 -1
  481. package/lib/models/resolveModel.js.map +1 -1
  482. package/lib/models/search/CaseSearchModel.js.map +1 -1
  483. package/lib/models/sorting/SortOptionModel.js.map +1 -1
  484. package/lib/models/sorting/SortingModel.js.map +1 -1
  485. package/lib/models/tab/TabModel.js.map +1 -1
  486. package/lib/models/taskgroup/TaskGroupCollection.js.map +1 -1
  487. package/lib/models/taskgroup/TaskGroupModel.js.map +1 -1
  488. package/lib/models/types.js.map +1 -1
  489. package/lib/models/user/UserModel.js.map +1 -1
  490. package/lib/models/user/UserProfileModel.js.map +1 -1
  491. package/lib/models/user/UserServicesModel.js.map +1 -1
  492. package/lib/modularui/Authenticate.js.map +1 -1
  493. package/lib/modularui/CaptchaRequest.js.map +1 -1
  494. package/lib/modularui/ModularUIError.js.map +1 -1
  495. package/lib/modularui/ModularUIRequest.js.map +1 -1
  496. package/lib/modularui/ModularUIResponse.js.map +1 -1
  497. package/lib/modularui/UploadRequest.js.map +1 -1
  498. package/lib/modularui/index.js.map +1 -1
  499. package/lib/modularui/types.js.map +1 -1
  500. package/lib/react/ErrorBoundary.js.map +1 -1
  501. package/lib/react/ErrorBoundaryFallback.js.map +1 -1
  502. package/lib/react/index.js.map +1 -1
  503. package/lib/react/utils.js.map +1 -1
  504. package/lib/react-client/Init.js.map +1 -1
  505. package/lib/react-client/client.js.map +1 -1
  506. package/lib/react-client/contextPath.js.map +1 -1
  507. package/lib/react-client/index.js.map +1 -1
  508. package/lib/react-client/rehydrate.js.map +1 -1
  509. package/lib/react-server/contextPath.js.map +1 -1
  510. package/lib/react-server/createSSRComplete.js.map +1 -1
  511. package/lib/react-server/htmlpage.js.map +1 -1
  512. package/lib/react-server/index.js.map +1 -1
  513. package/lib/react-server/renderSSRComplete.js.map +1 -1
  514. package/lib/react-server/renderSSRMinimal.js.map +1 -1
  515. package/lib/react-server/requestInformation.js.map +1 -1
  516. package/lib/react-server/serverNoSSR.js.map +1 -1
  517. package/lib/react-server/serverSSR.js.map +1 -1
  518. package/lib/react-server/serverUtil.js.map +1 -1
  519. package/lib/react-theme/ThemeProvider.js.map +1 -1
  520. package/lib/react-theme/createTheme.js.map +1 -1
  521. package/lib/react-theme/index.js.map +1 -1
  522. package/lib/react-theme/types.js.map +1 -1
  523. package/lib/react-theme/useTheme.js.map +1 -1
  524. package/lib/react-theme/utils/background.js.map +1 -1
  525. package/lib/react-theme/utils/colors.js.map +1 -1
  526. package/lib/react-theme/utils/contrast.js.map +1 -1
  527. package/lib/react-theme/utils/corners.js.map +1 -1
  528. package/lib/react-theme/utils/spacers.js.map +1 -1
  529. package/lib/react-theme/utils/themeProps.js.map +1 -1
  530. package/lib/redux/_i18n/I18nActions.js.map +1 -1
  531. package/lib/redux/_i18n/I18nReducer.js.map +1 -1
  532. package/lib/redux/_i18n/index.js.map +1 -1
  533. package/lib/redux/_i18n/types.js.map +1 -1
  534. package/lib/redux/_modularui/ModularUIActions.js.map +1 -1
  535. package/lib/redux/_modularui/ModularUIConnector.js.map +1 -1
  536. package/lib/redux/_modularui/ModularUIMiddleware.js.map +1 -1
  537. package/lib/redux/_modularui/ModularUIReducer.js.map +1 -1
  538. package/lib/redux/_modularui/ModularUISelectors.js.map +1 -1
  539. package/lib/redux/_modularui/ModularUIUtils.js.map +1 -1
  540. package/lib/redux/_modularui/index.js.map +1 -1
  541. package/lib/redux/_modularui/types.js.map +1 -1
  542. package/lib/redux/_modularui/withModularUI.js.map +1 -1
  543. package/lib/redux/_router/RouterActions.js.map +1 -1
  544. package/lib/redux/_router/RouterConnectors.js.map +1 -1
  545. package/lib/redux/_router/RouterMiddleware.js.map +1 -1
  546. package/lib/redux/_router/RouterReducer.js.map +1 -1
  547. package/lib/redux/_router/index.js.map +1 -1
  548. package/lib/redux/_router/types.js.map +1 -1
  549. package/lib/redux/actions/Application.js.map +1 -1
  550. package/lib/redux/actions/Authorization.js.map +1 -1
  551. package/lib/redux/actions/Error.js.map +1 -1
  552. package/lib/redux/actions/Form.js.map +1 -1
  553. package/lib/redux/actions/FormAttributeSet.js.map +1 -1
  554. package/lib/redux/actions/FormAttributeSetRepeatable.js.map +1 -1
  555. package/lib/redux/actions/FormAutosave.js.map +1 -1
  556. package/lib/redux/actions/FormAutosubmit.js.map +1 -1
  557. package/lib/redux/actions/FormValidations.js.map +1 -1
  558. package/lib/redux/actions/Modals.js.map +1 -1
  559. package/lib/redux/actions/Notification.js.map +1 -1
  560. package/lib/redux/actions/Preferences.js.map +1 -1
  561. package/lib/redux/actions/ProgressIndicator.js.map +1 -1
  562. package/lib/redux/actions/SignIn.js.map +1 -1
  563. package/lib/redux/actions/SignOut.js.map +1 -1
  564. package/lib/redux/actions/index.js.map +1 -1
  565. package/lib/redux/connectors/Application.js.map +1 -1
  566. package/lib/redux/connectors/Breadcrumb.js.map +1 -1
  567. package/lib/redux/connectors/CaseView.js.map +1 -1
  568. package/lib/redux/connectors/ConceptDetail.js.map +1 -1
  569. package/lib/redux/connectors/ContentBrowser.js.map +1 -1
  570. package/lib/redux/connectors/ContentDetail.js.map +1 -1
  571. package/lib/redux/connectors/ContentDetailSection.js.map +1 -1
  572. package/lib/redux/connectors/Form.js.map +1 -1
  573. package/lib/redux/connectors/FormAttributeSet.js.map +1 -1
  574. package/lib/redux/connectors/ListDetail.js.map +1 -1
  575. package/lib/redux/connectors/Modal.js.map +1 -1
  576. package/lib/redux/connectors/ModelCatalog.js.map +1 -1
  577. package/lib/redux/connectors/Notification.js.map +1 -1
  578. package/lib/redux/connectors/PanelRenderer.js.map +1 -1
  579. package/lib/redux/connectors/Preferences.js.map +1 -1
  580. package/lib/redux/connectors/Progress.js.map +1 -1
  581. package/lib/redux/connectors/ProgressIndicator.js.map +1 -1
  582. package/lib/redux/connectors/QuickSearch.js.map +1 -1
  583. package/lib/redux/connectors/SignIn.js.map +1 -1
  584. package/lib/redux/connectors/SignOut.js.map +1 -1
  585. package/lib/redux/connectors/Tab.js.map +1 -1
  586. package/lib/redux/connectors/index.js.map +1 -1
  587. package/lib/redux/index.js.map +1 -1
  588. package/lib/redux/reducers/AuthReducer.js.map +1 -1
  589. package/lib/redux/reducers/ErrorReducer.js.map +1 -1
  590. package/lib/redux/reducers/ModalsReducer.js.map +1 -1
  591. package/lib/redux/reducers/NotificationReducer.js.map +1 -1
  592. package/lib/redux/reducers/PreferencesReducer.js.map +1 -1
  593. package/lib/redux/reducers/ProgressIndicatorReducer.js.map +1 -1
  594. package/lib/redux/reducers/createReducer.js.map +1 -1
  595. package/lib/redux/reducers/index.js.map +1 -1
  596. package/lib/redux/selectors/i18n.js.map +1 -1
  597. package/lib/redux/selectors/index.js.map +1 -1
  598. package/lib/redux/store/beforeRenderHooks.js.map +1 -1
  599. package/lib/redux/store/configureStore.js.map +1 -1
  600. package/lib/redux/types.js.map +1 -1
  601. package/lib/utils/browser/Cache.js.map +1 -1
  602. package/lib/utils/browser/Cookies.js.map +1 -1
  603. package/lib/utils/datetime/DateTimeUtil.js.map +1 -1
  604. package/lib/utils/fetch/serverFetch.js.map +1 -1
  605. package/lib/utils/fetch/types.js.map +1 -1
  606. package/lib/utils/fetch/universalFetch.js.map +1 -1
  607. package/lib/utils/fetch/xhr.js.map +1 -1
  608. package/lib/utils/helpers/__tests__/createHref.spec.js.flow +30 -0
  609. package/lib/utils/helpers/checkResource.js.map +1 -1
  610. package/lib/utils/helpers/createHash.js.map +1 -1
  611. package/lib/utils/helpers/createHref.js +78 -0
  612. package/lib/utils/helpers/createHref.js.flow +80 -0
  613. package/lib/utils/helpers/createHref.js.map +1 -0
  614. package/lib/utils/helpers/createUUID.js.map +1 -1
  615. package/lib/utils/helpers/index.js +12 -0
  616. package/lib/utils/helpers/index.js.flow +1 -0
  617. package/lib/utils/helpers/index.js.map +1 -1
  618. package/lib/utils/helpers/objects.js.map +1 -1
  619. package/lib/utils/helpers/repositoryResource.js.map +1 -1
  620. package/lib/utils/helpers/sanitizeHtml.js.map +1 -1
  621. package/lib/utils/helpers/text.js.map +1 -1
  622. package/lib/utils/index.js.map +1 -1
  623. package/lib/utils/number/DecimalFormat.js.map +1 -1
  624. package/lib/utils/number/formatValue.js.map +1 -1
  625. package/lib/utils/number/parseNumbers.js.map +1 -1
  626. package/package.json +1 -1
  627. package/src/hooks/__tests__/useModels.spec.js +96 -1
  628. package/src/hooks/useModelCatalog.js +13 -23
  629. package/src/hooks/useModels.js +17 -1
  630. package/src/utils/helpers/__tests__/createHref.spec.js +30 -0
  631. package/src/utils/helpers/createHref.js +80 -0
  632. package/src/utils/helpers/index.js +1 -0
@@ -1 +1 @@
1
- {"version":3,"file":"resolveModel.js","names":["_objects","require","_ApplicationModel","_interopRequireDefault","_CaseSearchModel","_CaseViewModel","_DetailModel","_FormModel","_GroupingPanelModel","_ListModel","_ListDetailModel","_TabModel","_TaskGroupModel","_UserModel","_UserProfileModel","_UserServicesModel","_ModelCatalogModel","_ConceptIndexModel","_BusinessScenarioModel","_ConceptDetailModel","_ConceptTypeDetailModel","_ContentIndexModel","_ContentTOCModel","_ContentModel","_ContentTypeModel","_LookupOptionsModel","_exceptions","RESOURCE_MODELS","ApplicationModel","TabModel","ListDetailModel","ListModel","GroupingPanelModel","CaseSearchModel","CaseViewModel","DetailModel","TaskGroupModel","FormModel","UserModel","UserProfileModel","UserServicesModel","ModelCatalogModel","ConceptIndexModel","BusinessScenarioModel","ConceptDetailModel","ConceptTypeDetailModel","ContentIndexModel","ContentTOCModel","ContentModel","ContentTypeModel","LookupOptionsModel","resolveModel","data","availableModels","arguments","length","undefined","IllegalArgumentException","has","contributions","resourceTypeModel","_find","default","call","resourceModel","isApplicableModel","_default","exports"],"sources":["../../src/models/resolveModel.js"],"sourcesContent":["// @flow\nimport { has } from \"../utils/helpers/objects\";\n\nimport ApplicationModel from \"./application/ApplicationModel\";\nimport CaseSearchModel from \"./search/CaseSearchModel\";\nimport CaseViewModel from \"./caseview/CaseViewModel\";\nimport DetailModel from \"./detail/DetailModel\";\nimport FormModel from \"./form/FormModel\";\nimport GroupingPanelModel from \"./panels/GroupingPanelModel\";\nimport ListModel from \"./list/ListModel\";\nimport ListDetailModel from \"./list/ListDetailModel\";\nimport TabModel from \"./tab/TabModel\";\nimport TaskGroupModel from \"./taskgroup/TaskGroupModel\";\nimport UserModel from \"./user/UserModel\";\nimport UserProfileModel from \"./user/UserProfileModel\";\nimport UserServicesModel from \"./user/UserServicesModel\";\nimport ModelCatalogModel from \"./modelcatalog/ModelCatalogModel\";\nimport ConceptIndexModel from \"./concepts/ConceptIndexModel\";\nimport BusinessScenarioModel from \"./concepts/BusinessScenarioModel\";\nimport ConceptDetailModel from \"./concepts/ConceptDetailModel\";\nimport ConceptTypeDetailModel from \"./concepts/ConceptTypeDetailModel\";\nimport ContentIndexModel from \"./content/ContentIndexModel\";\nimport ContentTOCModel from \"./content/ContentTOCModel\";\nimport ContentModel from \"./content/ContentModel\";\nimport ContentTypeModel from \"./content/ContentTypeModel\";\nimport LookupOptionsModel from \"./lookup/LookupOptionsModel\";\n\nimport { IllegalArgumentException } from \"../exceptions\";\n\nimport type ModularUIResponse from \"../modularui/ModularUIResponse\";\nimport type { ModularUIModel } from \"./types\";\n\n/**\n * Mapping of models and resourcetypes\n */\nconst RESOURCE_MODELS = [\n ApplicationModel,\n TabModel,\n ListDetailModel,\n ListModel,\n GroupingPanelModel,\n CaseSearchModel,\n CaseViewModel,\n DetailModel,\n TaskGroupModel,\n FormModel,\n UserModel,\n UserProfileModel,\n UserServicesModel,\n ModelCatalogModel,\n ConceptIndexModel,\n BusinessScenarioModel,\n ConceptDetailModel,\n ConceptTypeDetailModel,\n ContentIndexModel,\n ContentTOCModel,\n ContentModel,\n ContentTypeModel,\n LookupOptionsModel,\n];\n\n/**\n * Resolve a model by resource\n */\nconst resolveModel = (\n data: ModularUIResponse,\n availableModels: Array<Class<ModularUIModel>> = RESOURCE_MODELS,\n): Class<ModularUIModel> | null => {\n if (!data) {\n throw new IllegalArgumentException(\n \"No data or contribution available, cannot resolve model\",\n );\n }\n\n if (!has(data.contributions, \"resourcetype\")) {\n throw new IllegalArgumentException(\n \"Data has wrong format, missing resourcetype property in contributions, cannot resolve model\",\n );\n }\n\n const resourceTypeModel = availableModels.find((resourceModel) =>\n resourceModel.isApplicableModel(data),\n );\n\n if (resourceTypeModel) {\n return resourceTypeModel;\n }\n\n return null;\n};\n\nexport default resolveModel;\n"],"mappings":";;;;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AAEA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,cAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,YAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,UAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,mBAAA,GAAAL,sBAAA,CA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CACnB;;AAED;AACA;AACA;AACA,MAAMC,YAAY,GAAG,SAAAA,CACnBC,IAAuB,EAEU;EAAA,IADjCC,eAA6C,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG3B,eAAe;EAE/D,IAAI,CAACyB,IAAI,EAAE;IACT,MAAM,IAAIK,oCAAwB,CAChC,yDACF,CAAC;EACH;EAEA,IAAI,CAAC,IAAAC,YAAG,EAACN,IAAI,CAACO,aAAa,EAAE,cAAc,CAAC,EAAE;IAC5C,MAAM,IAAIF,oCAAwB,CAChC,6FACF,CAAC;EACH;EAEA,MAAMG,iBAAiB,GAAG,IAAAC,KAAA,CAAAC,OAAA,EAAAT,eAAe,EAAAU,IAAA,CAAfV,eAAe,EAAOW,aAAa,IAC3DA,aAAa,CAACC,iBAAiB,CAACb,IAAI,CACtC,CAAC;EAED,IAAIQ,iBAAiB,EAAE;IACrB,OAAOA,iBAAiB;EAC1B;EAEA,OAAO,IAAI;AACb,CAAC;AAAC,IAAAM,QAAA,GAAAC,OAAA,CAAAL,OAAA,GAEaX,YAAY"}
1
+ {"version":3,"file":"resolveModel.js","names":["_objects","require","_ApplicationModel","_interopRequireDefault","_CaseSearchModel","_CaseViewModel","_DetailModel","_FormModel","_GroupingPanelModel","_ListModel","_ListDetailModel","_TabModel","_TaskGroupModel","_UserModel","_UserProfileModel","_UserServicesModel","_ModelCatalogModel","_ConceptIndexModel","_BusinessScenarioModel","_ConceptDetailModel","_ConceptTypeDetailModel","_ContentIndexModel","_ContentTOCModel","_ContentModel","_ContentTypeModel","_LookupOptionsModel","_exceptions","RESOURCE_MODELS","ApplicationModel","TabModel","ListDetailModel","ListModel","GroupingPanelModel","CaseSearchModel","CaseViewModel","DetailModel","TaskGroupModel","FormModel","UserModel","UserProfileModel","UserServicesModel","ModelCatalogModel","ConceptIndexModel","BusinessScenarioModel","ConceptDetailModel","ConceptTypeDetailModel","ContentIndexModel","ContentTOCModel","ContentModel","ContentTypeModel","LookupOptionsModel","resolveModel","data","availableModels","arguments","length","undefined","IllegalArgumentException","has","contributions","resourceTypeModel","_find","default","call","resourceModel","isApplicableModel","_default","exports"],"sources":["../../src/models/resolveModel.js"],"sourcesContent":["// @flow\nimport { has } from \"../utils/helpers/objects\";\n\nimport ApplicationModel from \"./application/ApplicationModel\";\nimport CaseSearchModel from \"./search/CaseSearchModel\";\nimport CaseViewModel from \"./caseview/CaseViewModel\";\nimport DetailModel from \"./detail/DetailModel\";\nimport FormModel from \"./form/FormModel\";\nimport GroupingPanelModel from \"./panels/GroupingPanelModel\";\nimport ListModel from \"./list/ListModel\";\nimport ListDetailModel from \"./list/ListDetailModel\";\nimport TabModel from \"./tab/TabModel\";\nimport TaskGroupModel from \"./taskgroup/TaskGroupModel\";\nimport UserModel from \"./user/UserModel\";\nimport UserProfileModel from \"./user/UserProfileModel\";\nimport UserServicesModel from \"./user/UserServicesModel\";\nimport ModelCatalogModel from \"./modelcatalog/ModelCatalogModel\";\nimport ConceptIndexModel from \"./concepts/ConceptIndexModel\";\nimport BusinessScenarioModel from \"./concepts/BusinessScenarioModel\";\nimport ConceptDetailModel from \"./concepts/ConceptDetailModel\";\nimport ConceptTypeDetailModel from \"./concepts/ConceptTypeDetailModel\";\nimport ContentIndexModel from \"./content/ContentIndexModel\";\nimport ContentTOCModel from \"./content/ContentTOCModel\";\nimport ContentModel from \"./content/ContentModel\";\nimport ContentTypeModel from \"./content/ContentTypeModel\";\nimport LookupOptionsModel from \"./lookup/LookupOptionsModel\";\n\nimport { IllegalArgumentException } from \"../exceptions\";\n\nimport type ModularUIResponse from \"../modularui/ModularUIResponse\";\nimport type { ModularUIModel } from \"./types\";\n\n/**\n * Mapping of models and resourcetypes\n */\nconst RESOURCE_MODELS = [\n ApplicationModel,\n TabModel,\n ListDetailModel,\n ListModel,\n GroupingPanelModel,\n CaseSearchModel,\n CaseViewModel,\n DetailModel,\n TaskGroupModel,\n FormModel,\n UserModel,\n UserProfileModel,\n UserServicesModel,\n ModelCatalogModel,\n ConceptIndexModel,\n BusinessScenarioModel,\n ConceptDetailModel,\n ConceptTypeDetailModel,\n ContentIndexModel,\n ContentTOCModel,\n ContentModel,\n ContentTypeModel,\n LookupOptionsModel,\n];\n\n/**\n * Resolve a model by resource\n */\nconst resolveModel = (\n data: ModularUIResponse,\n availableModels: Array<Class<ModularUIModel>> = RESOURCE_MODELS,\n): Class<ModularUIModel> | null => {\n if (!data) {\n throw new IllegalArgumentException(\n \"No data or contribution available, cannot resolve model\",\n );\n }\n\n if (!has(data.contributions, \"resourcetype\")) {\n throw new IllegalArgumentException(\n \"Data has wrong format, missing resourcetype property in contributions, cannot resolve model\",\n );\n }\n\n const resourceTypeModel = availableModels.find((resourceModel) =>\n resourceModel.isApplicableModel(data),\n );\n\n if (resourceTypeModel) {\n return resourceTypeModel;\n }\n\n return null;\n};\n\nexport default resolveModel;\n"],"mappings":";;;;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AAEA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,cAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,YAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,UAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,mBAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,UAAA,GAAAN,sBAAA,CAAAF,OAAA;AACA,IAAAS,gBAAA,GAAAP,sBAAA,CAAAF,OAAA;AACA,IAAAU,SAAA,GAAAR,sBAAA,CAAAF,OAAA;AACA,IAAAW,eAAA,GAAAT,sBAAA,CAAAF,OAAA;AACA,IAAAY,UAAA,GAAAV,sBAAA,CAAAF,OAAA;AACA,IAAAa,iBAAA,GAAAX,sBAAA,CAAAF,OAAA;AACA,IAAAc,kBAAA,GAAAZ,sBAAA,CAAAF,OAAA;AACA,IAAAe,kBAAA,GAA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AwB,CAChC,6FACF,CAAC;EACH;EAEA,MAAMG,iBAAiB,GAAG,IAAAC,KAAA,CAAAC,OAAA,EAAAT,eAAe,EAAAU,IAAA,CAAfV,eAAe,EAAOW,aAAa,IAC3DA,aAAa,CAACC,iBAAiB,CAACb,IAAI,CACtC,CAAC;EAED,IAAIQ,iBAAiB,EAAE;IACrB,OAAOA,iBAAiB;EAC1B;EAEA,OAAO,IAAI;AACb,CAAC;AAAC,IAAAM,QAAA,GAAAC,OAAA,CAAAL,OAAA,GAEaX,YAAY","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"CaseSearchModel.js","names":["_ListModel","_interopRequireDefault","require","CaseSearchModel","ListModel","type","modelName","isApplicableModel","data","contributions","resourcetype","getQuickSearchFilters","_context","filterCollection","_filter","default","call","filter","isQuickSearch","hasQuickSearchFilters","length","exports"],"sources":["../../../src/models/search/CaseSearchModel.js"],"sourcesContent":["// @flow\nimport ListModel from \"../list/ListModel\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { FilterType } from \"../types\";\n\n/**\n * Case search model\n */\nexport default class CaseSearchModel extends ListModel {\n /**\n */\n get type(): string {\n return \"CaseSearch\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"CaseSearchModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"CaseSearch\"\n );\n }\n\n /**\n * Retrieve quick search filters\n */\n getQuickSearchFilters(): Array<FilterType> {\n return this.filterCollection\n ? this.filterCollection.filter((filter) => filter.isQuickSearch())\n : [];\n }\n\n /**\n */\n hasQuickSearchFilters(): boolean {\n return this.getQuickSearchFilters().length > 0;\n }\n}\n"],"mappings":";;;;;;;;AACA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA;AACA;AACA;AACe,MAAMC,eAAe,SAASC,kBAAS,CAAC;EACrD;AACF;EACE,IAAIC,IAAIA,CAAA,EAAW;IACjB,OAAO,YAAY;EACrB;;EAEA;AACF;EACE,WAAWC,SAASA,CAAA,EAAW;IAC7B,OAAO,iBAAiB;EAC1B;;EAEA;AACF;EACE,OAAOC,iBAAiBA,CAACC,IAAuB,EAAW;IACzD,OACEA,IAAI,CAACC,aAAa,CAACC,YAAY,IAC/BF,IAAI,CAACC,aAAa,CAACC,YAAY,KAAK,YAAY;EAEpD;;EAEA;AACF;AACA;EACEC,qBAAqBA,CAAA,EAAsB;IAAA,IAAAC,QAAA;IACzC,OAAO,IAAI,CAACC,gBAAgB,GACxB,IAAAC,OAAA,CAAAC,OAAA,EAAAH,QAAA,OAAI,CAACC,gBAAgB,EAAAG,IAAA,CAAAJ,QAAA,EAASK,MAAM,IAAKA,MAAM,CAACC,aAAa,CAAC,CAAC,CAAC,GAChE,EAAE;EACR;;EAEA;AACF;EACEC,qBAAqBA,CAAA,EAAY;IAC/B,OAAO,IAAI,CAACR,qBAAqB,CAAC,CAAC,CAACS,MAAM,GAAG,CAAC;EAChD;AACF;AAACC,OAAA,CAAAN,OAAA,GAAAZ,eAAA"}
1
+ {"version":3,"file":"CaseSearchModel.js","names":["_ListModel","_interopRequireDefault","require","CaseSearchModel","ListModel","type","modelName","isApplicableModel","data","contributions","resourcetype","getQuickSearchFilters","_context","filterCollection","_filter","default","call","filter","isQuickSearch","hasQuickSearchFilters","length","exports"],"sources":["../../../src/models/search/CaseSearchModel.js"],"sourcesContent":["// @flow\nimport ListModel from \"../list/ListModel\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { FilterType } from \"../types\";\n\n/**\n * Case search model\n */\nexport default class CaseSearchModel extends ListModel {\n /**\n */\n get type(): string {\n return \"CaseSearch\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"CaseSearchModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"CaseSearch\"\n );\n }\n\n /**\n * Retrieve quick search filters\n */\n getQuickSearchFilters(): Array<FilterType> {\n return this.filterCollection\n ? this.filterCollection.filter((filter) => filter.isQuickSearch())\n : [];\n }\n\n /**\n */\n hasQuickSearchFilters(): boolean {\n return this.getQuickSearchFilters().length > 0;\n }\n}\n"],"mappings":";;;;;;;;AACA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA;AACA;AACA;AACe,MAAMC,eAAe,SAASC,kBAAS,CAAC;EACrD;AACF;EACE,IAAIC,IAAIA,CAAA,EAAW;IACjB,OAAO,YAAY;EACrB;;EAEA;AACF;EACE,WAAWC,SAASA,CAAA,EAAW;IAC7B,OAAO,iBAAiB;EAC1B;;EAEA;AACF;EACE,OAAOC,iBAAiBA,CAACC,IAAuB,EAAW;IACzD,OACEA,IAAI,CAACC,aAAa,CAACC,YAAY,IAC/BF,IAAI,CAACC,aAAa,CAACC,YAAY,KAAK,YAAY;EAEpD;;EAEA;AACF;AACA;EACEC,qBAAqBA,CAAA,EAAsB;IAAA,IAAAC,QAAA;IACzC,OAAO,IAAI,CAACC,gBAAgB,GACxB,IAAAC,OAAA,CAAAC,OAAA,EAAAH,QAAA,OAAI,CAACC,gBAAgB,EAAAG,IAAA,CAAAJ,QAAA,EAASK,MAAM,IAAKA,MAAM,CAACC,aAAa,CAAC,CAAC,CAAC,GAChE,EAAE;EACR;;EAEA;AACF;EACEC,qBAAqBA,CAAA,EAAY;IAC/B,OAAO,IAAI,CAACR,qBAAqB,CAAC,CAAC,CAACS,MAAM,GAAG,CAAC;EAChD;AACF;AAACC,OAAA,CAAAN,OAAA,GAAAZ,eAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"SortOptionModel.js","names":["_ListHref","_interopRequireDefault","require","SortOptionModel","constructor","key","label","group","_defineProperty2","default","_key","_group","_label","attribute","getAttributeByKey","selected","_selected","value","sortorder","oppositeDirection","oppositeValue","_sortorder","getHref","listHref","listhref","ListHref","hasPage","prefix","hasParameter","page","sort","_default","exports"],"sources":["../../../src/models/sorting/SortOptionModel.js"],"sourcesContent":["// @flow\nimport type { GroupModel } from \"../grouping/GroupingModel\";\n\nimport ListHref from \"../href/ListHref\";\n\n/**\n */\nclass SortOptionModel {\n _key: string;\n _label: string;\n _group: ?GroupModel;\n _sortorder: \"desc\" | \"asc\" = \"desc\";\n _selected: boolean = false;\n\n /**\n */\n constructor(key: string, label?: string, group?: ?GroupModel) {\n this._key = key;\n this._group = group;\n\n if (label) {\n this._label = label;\n } else if (group) {\n const attribute = group.getAttributeByKey(key);\n if (attribute) {\n this._label = attribute.label;\n }\n }\n }\n\n /**\n */\n get selected(): boolean {\n return this._selected;\n }\n\n /**\n */\n set selected(selected: boolean) {\n this._selected = selected;\n }\n\n /**\n */\n get key(): string {\n return this._key;\n }\n\n /**\n */\n get value(): string {\n return `${this.key} ${this.sortorder}`;\n }\n\n /**\n */\n get oppositeDirection(): \"asc\" | \"desc\" {\n return this.sortorder === \"desc\" ? \"asc\" : \"desc\";\n }\n\n /**\n */\n get oppositeValue(): string {\n return `${this.key} ${this.oppositeDirection}`;\n }\n\n /**\n */\n get label(): string {\n return this._label;\n }\n\n /**\n */\n get sortorder(): \"desc\" | \"asc\" {\n return this._sortorder;\n }\n\n /**\n */\n set sortorder(sortorder: \"desc\" | \"asc\") {\n this._sortorder = sortorder;\n }\n\n /**\n */\n get group(): ?GroupModel {\n return this._group;\n }\n\n /**\n */\n getHref(listHref: ListHref): ListHref {\n const listhref = new ListHref(listHref);\n const hasPage = listhref.prefix\n ? listhref.hasParameter(\"page\", listhref.prefix)\n : listhref.hasParameter(\"page\");\n if (hasPage) {\n listhref.page = 1;\n }\n listhref.sort = this.oppositeValue;\n\n return listhref;\n }\n}\n\nexport default SortOptionModel;\n"],"mappings":";;;;;;;;AAGA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA;AACA;AACA,MAAMC,eAAe,CAAC;EAOpB;AACF;EACEC,WAAWA,CAACC,GAAW,EAAEC,KAAc,EAAEC,KAAmB,EAAE;IAAA,IAAAC,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A,CAAA,EAAmB;IAC9B,OAAO,IAAI,CAACG,UAAU;EACxB;;EAEA;AACF;EACE,IAAIH,SAASA,CAACA,SAAyB,EAAE;IACvC,IAAI,CAACG,UAAU,GAAGH,SAAS;EAC7B;;EAEA;AACF;EACE,IAAIX,KAAKA,CAAA,EAAgB;IACvB,OAAO,IAAI,CAACI,MAAM;EACpB;;EAEA;AACF;EACEW,OAAOA,CAACC,QAAkB,EAAY;IACpC,MAAMC,QAAQ,GAAG,IAAIC,iBAAQ,CAACF,QAAQ,CAAC;IACvC,MAAMG,OAAO,GAAGF,QAAQ,CAACG,MAAM,GAC3BH,QAAQ,CAACI,YAAY,CAAC,MAAM,EAAEJ,QAAQ,CAACG,MAAM,CAAC,GAC9CH,QAAQ,CAACI,YAAY,CAAC,MAAM,CAAC;IACjC,IAAIF,OAAO,EAAE;MACXF,QAAQ,CAACK,IAAI,GAAG,CAAC;IACnB;IACAL,QAAQ,CAACM,IAAI,GAAG,IAAI,CAACV,aAAa;IAElC,OAAOI,QAAQ;EACjB;AACF;AAAC,IAAAO,QAAA,GAAAC,OAAA,CAAAvB,OAAA,GAEcN,eAAe"}
1
+ {"version":3,"file":"SortOptionModel.js","names":["_ListHref","_interopRequireDefault","require","SortOptionModel","constructor","key","label","group","_defineProperty2","default","_key","_group","_label","attribute","getAttributeByKey","selected","_selected","value","sortorder","oppositeDirection","oppositeValue","_sortorder","getHref","listHref","listhref","ListHref","hasPage","prefix","hasParameter","page","sort","_default","exports"],"sources":["../../../src/models/sorting/SortOptionModel.js"],"sourcesContent":["// @flow\nimport type { GroupModel } from \"../grouping/GroupingModel\";\n\nimport ListHref from \"../href/ListHref\";\n\n/**\n */\nclass SortOptionModel {\n _key: string;\n _label: string;\n _group: ?GroupModel;\n _sortorder: \"desc\" | \"asc\" = \"desc\";\n _selected: boolean = false;\n\n /**\n */\n constructor(key: string, label?: string, group?: ?GroupModel) {\n this._key = key;\n this._group = group;\n\n if (label) {\n this._label = label;\n } else if (group) {\n const attribute = group.getAttributeByKey(key);\n if (attribute) {\n this._label = attribute.label;\n }\n }\n }\n\n /**\n */\n get selected(): boolean {\n return this._selected;\n }\n\n /**\n */\n set selected(selected: boolean) {\n this._selected = selected;\n }\n\n /**\n */\n get key(): string {\n return this._key;\n }\n\n /**\n */\n get value(): string {\n return `${this.key} ${this.sortorder}`;\n }\n\n /**\n */\n get oppositeDirection(): \"asc\" | \"desc\" {\n return this.sortorder === \"desc\" ? \"asc\" : \"desc\";\n }\n\n /**\n */\n get oppositeValue(): string {\n return `${this.key} ${this.oppositeDirection}`;\n }\n\n /**\n */\n get label(): string {\n return this._label;\n }\n\n /**\n */\n get sortorder(): \"desc\" | \"asc\" {\n return this._sortorder;\n }\n\n /**\n */\n set sortorder(sortorder: \"desc\" | \"asc\") {\n this._sortorder = sortorder;\n }\n\n /**\n */\n get group(): ?GroupModel {\n return this._group;\n }\n\n /**\n */\n getHref(listHref: ListHref): ListHref {\n const listhref = new ListHref(listHref);\n const hasPage = listhref.prefix\n ? listhref.hasParameter(\"page\", listhref.prefix)\n : listhref.hasParameter(\"page\");\n if (hasPage) {\n listhref.page = 1;\n }\n listhref.sort = this.oppositeValue;\n\n return listhref;\n }\n}\n\nexport default SortOptionModel;\n"],"mappings":";;;;;;;;AAGA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA;AACA;AACA,MAAMC,eAAe,CAAC;EAOpB;AACF;EACEC,WAAWA,CAACC,GAAW,EAAEC,KAAc,EAAEC,KAAmB,EAAE;IAAA,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA,sBALjC,MAAM;IAAA,IAAAD,gBAAA,CAAAC,OAAA,qBACd,KAAK;IAKxB,IAAI,CAACC,IAAI,GAAGL,GAAG;IACf,IAAI,CAACM,MAAM,GAAGJ,KAAK;IAEnB,IAAID,KAAK,EAAE;MAC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,QAAQ,GAAG,IAAIC,iBAAQ,CAACF,QAAQ,CAAC;IACvC,MAAMG,OAAO,GAAGF,QAAQ,CAACG,MAAM,GAC3BH,QAAQ,CAACI,YAAY,CAAC,MAAM,EAAEJ,QAAQ,CAACG,MAAM,CAAC,GAC9CH,QAAQ,CAACI,YAAY,CAAC,MAAM,CAAC;IACjC,IAAIF,OAAO,EAAE;MACXF,QAAQ,CAACK,IAAI,GAAG,CAAC;IACnB;IACAL,QAAQ,CAACM,IAAI,GAAG,IAAI,CAACV,aAAa;IAElC,OAAOI,QAAQ;EACjB;AACF;AAAC,IAAAO,QAAA,GAAAC,OAAA,CAAAvB,OAAA,GAEcN,eAAe","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"SortingModel.js","names":["_objects","require","_BaseCollection","_interopRequireDefault","_SortOptionModel","_ListHref","_IllegalArgumentException","SortingModel","BaseCollection","constructor","contributions","labels","grouping","currentSort","has","sorting","_context","collection","_map","default","attributes","call","attributeKey","label","group","getGroupByAttributeKey","SortOptionModel","setSelected","name","value","_context2","_context3","_filter","option","selected","join","param","options","arguments","length","undefined","split","forEach","sortItem","key","direction","sortorder","getUpdateQuerystring","optionKey","_context4","_context5","IllegalArgumentException","oppositeValue","getUpdateQuerystringBySortOption","sortOption","createListHref","listHref","listhref","ListHref","hasPage","prefix","hasParameter","page","sort","_default","exports"],"sources":["../../../src/models/sorting/SortingModel.js"],"sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\n\nimport BaseCollection from \"../base/BaseCollection\";\nimport SortOptionModel from \"../sorting/SortOptionModel\";\nimport ListHref from \"../href/ListHref\";\n\nimport type GroupingModel from \"../grouping/GroupingModel\";\nimport IllegalArgumentException from \"../../exceptions/IllegalArgumentException\";\n\n/**\n */\nclass SortingModel extends BaseCollection<SortOptionModel> {\n /**\n */\n constructor(\n contributions: Object,\n labels: { [key: string]: string },\n grouping: GroupingModel,\n currentSort: string,\n ) {\n super();\n\n if (has(contributions?.sorting, \"attributes\")) {\n this.collection = contributions.sorting.attributes.map((attributeKey) => {\n const label = labels[attributeKey];\n const group = grouping && grouping.getGroupByAttributeKey(attributeKey);\n\n return new SortOptionModel(attributeKey, label, group);\n });\n\n this.setSelected(currentSort);\n }\n }\n\n /**\n */\n get name(): string {\n return \"sort\";\n }\n\n /**\n */\n get value(): string {\n return this.filter((option) => option.selected)\n .map((option) => option.value)\n .join(\",\");\n }\n\n /**\n */\n get param(): string {\n return this.value;\n }\n\n /**\n */\n get options(): Array<SortOptionModel> {\n return this.collection;\n }\n\n /**\n */\n setSelected(currentSort: string = \"\") {\n currentSort.split(\",\").forEach((sortItem) => {\n const [key, direction] = sortItem.split(\" \");\n\n this.collection.forEach((option) => {\n if (option.key === key) {\n option.selected = true;\n if (direction === \"asc\") {\n option.sortorder = \"asc\";\n } else if (direction === \"desc\") {\n option.sortorder = \"desc\";\n }\n }\n });\n });\n }\n\n /**\n * Retrieve a sort option from the model that can be used in the querystring to set it in the opposite direction\n * For example a sort option in the model with key books and direction descending will be retrieved as 'Books asc'\n */\n getUpdateQuerystring(optionKey: string): string {\n if (!optionKey) {\n throw new IllegalArgumentException(\n \"Missing option key as input argument\",\n );\n }\n\n return this.filter((option) => option.key === optionKey)\n .map((option) =>\n option.key === optionKey ? option.oppositeValue : option.value,\n )\n .join(\",\");\n }\n\n /**\n * @see {@link SortingModel#getUpdateQuerystring}\n */\n getUpdateQuerystringBySortOption(sortOption: SortOptionModel): string {\n if (!(sortOption instanceof SortOptionModel)) {\n throw new IllegalArgumentException(\n \"Missing SortOptionModel as input argument\",\n );\n }\n\n return this.getUpdateQuerystring(sortOption.key);\n }\n\n /**\n */\n createListHref(listHref: ListHref, sortOption: SortOptionModel): ListHref {\n const listhref = new ListHref(listHref);\n const hasPage = listhref.prefix\n ? listhref.hasParameter(\"page\", listhref.prefix)\n : listhref.hasParameter(\"page\");\n if (hasPage) {\n listhref.page = 1;\n }\n listhref.sort = this.getUpdateQuerystringBySortOption(sortOption);\n\n return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A+B,SAAA,OAAI,EAAA7B,IAAA,CAAA6B,SAAA,EAASjB,MAAM,IAAKA,MAAM,CAACW,GAAG,KAAKI,SAAS,CAAC,EAAA3B,IAAA,CAAA4B,SAAA,EAChDhB,MAAM,IACVA,MAAM,CAACW,GAAG,KAAKI,SAAS,GAAGf,MAAM,CAACmB,aAAa,GAAGnB,MAAM,CAACJ,KAC3D,CAAC,CACAM,IAAI,CAAC,GAAG,CAAC;EACd;;EAEA;AACF;AACA;EACEkB,gCAAgCA,CAACC,UAA2B,EAAU;IACpE,IAAI,EAAEA,UAAU,YAAY5B,wBAAe,CAAC,EAAE;MAC5C,MAAM,IAAIyB,iCAAwB,CAChC,2CACF,CAAC;IACH;IAEA,OAAO,IAAI,CAACJ,oBAAoB,CAACO,UAAU,CAACV,GAAG,CAAC;EAClD;;EAEA;AACF;EACEW,cAAcA,CAACC,QAAkB,EAAEF,UAA2B,EAAY;IACxE,MAAMG,QAAQ,GAAG,IAAIC,iBAAQ,CAACF,QAAQ,CAAC;IACvC,MAAMG,OAAO,GAAGF,QAAQ,CAACG,MAAM,GAC3BH,QAAQ,CAACI,YAAY,CAAC,MAAM,EAAEJ,QAAQ,CAACG,MAAM,CAAC,GAC9CH,QAAQ,CAACI,YAAY,CAAC,MAAM,CAAC;IACjC,IAAIF,OAAO,EAAE;MACXF,QAAQ,CAACK,IAAI,GAAG,CAAC;IACnB;IACAL,QAAQ,CAACM,IAAI,GAAG,IAAI,CAACV,gCAAgC,CAACC,UAAU,CAAC;IAEjE,OAAOG,QAAQ;EACjB;AACF;AAAC,IAAAO,QAAA,GAAAC,OAAA,CAAA9C,OAAA,GAEcZ,YAAY"}
1
+ {"version":3,"file":"SortingModel.js","names":["_objects","require","_BaseCollection","_interopRequireDefault","_SortOptionModel","_ListHref","_IllegalArgumentException","SortingModel","BaseCollection","constructor","contributions","labels","grouping","currentSort","has","sorting","_context","collection","_map","default","attributes","call","attributeKey","label","group","getGroupByAttributeKey","SortOptionModel","setSelected","name","value","_context2","_context3","_filter","option","selected","join","param","options","arguments","length","undefined","split","forEach","sortItem","key","direction","sortorder","getUpdateQuerystring","optionKey","_context4","_context5","IllegalArgumentException","oppositeValue","getUpdateQuerystringBySortOption","sortOption","createListHref","listHref","listhref","ListHref","hasPage","prefix","hasParameter","page","sort","_default","exports"],"sources":["../../../src/models/sorting/SortingModel.js"],"sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\n\nimport BaseCollection from \"../base/BaseCollection\";\nimport SortOptionModel from \"../sorting/SortOptionModel\";\nimport ListHref from \"../href/ListHref\";\n\nimport type GroupingModel from \"../grouping/GroupingModel\";\nimport IllegalArgumentException from \"../../exceptions/IllegalArgumentException\";\n\n/**\n */\nclass SortingModel extends BaseCollection<SortOptionModel> {\n /**\n */\n constructor(\n contributions: Object,\n labels: { [key: string]: string },\n grouping: GroupingModel,\n currentSort: string,\n ) {\n super();\n\n if (has(contributions?.sorting, \"attributes\")) {\n this.collection = contributions.sorting.attributes.map((attributeKey) => {\n const label = labels[attributeKey];\n const group = grouping && grouping.getGroupByAttributeKey(attributeKey);\n\n return new SortOptionModel(attributeKey, label, group);\n });\n\n this.setSelected(currentSort);\n }\n }\n\n /**\n */\n get name(): string {\n return \"sort\";\n }\n\n /**\n */\n get value(): string {\n return this.filter((option) => option.selected)\n .map((option) => option.value)\n .join(\",\");\n }\n\n /**\n */\n get param(): string {\n return this.value;\n }\n\n /**\n */\n get options(): Array<SortOptionModel> {\n return this.collection;\n }\n\n /**\n */\n setSelected(currentSort: string = \"\") {\n currentSort.split(\",\").forEach((sortItem) => {\n const [key, direction] = sortItem.split(\" \");\n\n this.collection.forEach((option) => {\n if (option.key === key) {\n option.selected = true;\n if (direction === \"asc\") {\n option.sortorder = \"asc\";\n } else if (direction === \"desc\") {\n option.sortorder = \"desc\";\n }\n }\n });\n });\n }\n\n /**\n * Retrieve a sort option from the model that can be used in the querystring to set it in the opposite direction\n * For example a sort option in the model with key books and direction descending will be retrieved as 'Books asc'\n */\n getUpdateQuerystring(optionKey: string): string {\n if (!optionKey) {\n throw new IllegalArgumentException(\n \"Missing option key as input argument\",\n );\n }\n\n return this.filter((option) => option.key === optionKey)\n .map((option) =>\n option.key === optionKey ? option.oppositeValue : option.value,\n )\n .join(\",\");\n }\n\n /**\n * @see {@link SortingModel#getUpdateQuerystring}\n */\n getUpdateQuerystringBySortOption(sortOption: SortOptionModel): string {\n if (!(sortOption instanceof SortOptionModel)) {\n throw new IllegalArgumentException(\n \"Missing SortOptionModel as input argument\",\n );\n }\n\n return this.getUpdateQuerystring(sortOption.key);\n }\n\n /**\n */\n createListHref(listHref: ListHref, sortOption: SortOptionModel): ListHref {\n const listhref = new ListHref(listHref);\n const hasPage = listhref.prefix\n ? listhref.hasParameter(\"page\", listhref.prefix)\n : listhref.hasParameter(\"page\");\n if (hasPage) {\n listhref.page = 1;\n }\n listhref.sort = this.getUpdateQuerystringBySortOption(sortOption);\n\n return listhref;\n }\n}\n\nexport default SortingModel;\n"],"mappings":";;;;;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AAEA,IAAAC,eAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,SAAA,GAAAF,sBAAA,CAAAF,OAAA;AAGA,IAAAK,yBAAA,GAAAH,sBAAA,CAAAF,OAAA;AAEA;AACA;AACA,MAAMM,YAAY,SAASC,uBAAc,CAAkB;EACzD;AACF;EACEC,WAAWA,CACTC,aAAqB,EACrBC,MAAiC,EACjCC,QAAuB,EACvBC,WAAmB,EACnB;IACA,KAAK,CAAC,CAAC;IAEP,IAAI,IAAAC,YAAG,EAACJ,aAAa,EAAEK,OAAO,EAAE,YAAY,CAAC,EAAE;MAAA,IAAAC,QAAA;MAC7C,IAAI,CAACC,UAAU,GAAG,IAAAC,IAAA,CAAAC,OAAA,EAAAH,QAAA,GAAAN,aAAa,CAACK,OAAO,CAACK,UAAU,EAAAC,IAAA,CAAAL,Q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GF,QAAQ,CAACG,MAAM,GAC3BH,QAAQ,CAACI,YAAY,CAAC,MAAM,EAAEJ,QAAQ,CAACG,MAAM,CAAC,GAC9CH,QAAQ,CAACI,YAAY,CAAC,MAAM,CAAC;IACjC,IAAIF,OAAO,EAAE;MACXF,QAAQ,CAACK,IAAI,GAAG,CAAC;IACnB;IACAL,QAAQ,CAACM,IAAI,GAAG,IAAI,CAACV,gCAAgC,CAACC,UAAU,CAAC;IAEjE,OAAOG,QAAQ;EACjB;AACF;AAAC,IAAAO,QAAA,GAAAC,OAAA,CAAA9C,OAAA,GAEcZ,YAAY","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"TabModel.js","names":["_TaskGroupCollection","_interopRequireDefault","require","_ResourceModel","_TaskGroupModel","_ActionCollection","TabModel","ResourceModel","constructor","modularuiResponse","_defineProperty2","default","createTaskGroupCollection","_actionCollection","ActionCollection","data","actions","contributions","type","modelName","isApplicableModel","_context","_context2","resourcetype","_endsWith","call","getInitialChildModelLinks","links","getLinksByGroup","all","setChildModels","models","taskGroups","i","length","TaskGroupModel","push","taskGroupCollection","add","searchLink","first","_context3","_context4","taskgroups","_filter","_map","taskgroup","_context5","taskgroupContributions","_find","taskgroupContribution","name","create","_taskGroupCollection","TaskGroupCollection","label","getContribution","components","actionCollection","hasComponents","size","hasTaskGroups","hasItems","hasActions","exports"],"sources":["../../../src/models/tab/TabModel.js"],"sourcesContent":["// @flow\nimport TaskGroupCollection from \"../taskgroup/TaskGroupCollection\";\nimport ResourceModel from \"../base/ResourceModel\";\nimport TaskGroupModel from \"../taskgroup/TaskGroupModel\";\nimport ActionCollection from \"../actions/ActionCollection\";\n\nimport type { ModularUIModel } from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type LinkCollection from \"../links/LinkCollection\";\n\n/**\n * Describes a TabModel\n */\nexport default class TabModel extends ResourceModel {\n _actionCollection: ActionCollection;\n _taskGroupCollection: TaskGroupCollection;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this.createTaskGroupCollection();\n\n this._actionCollection = new ActionCollection(\n this.data.actions,\n this.contributions.actions,\n );\n }\n\n /**\n */\n get type(): string {\n return \"Tab\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"TabModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n (data.contributions.resourcetype.endsWith(\"Tab\") ||\n data.contributions.resourcetype.endsWith(\"KnowledgeBank\"))\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this.links.getLinksByGroup(\"taskgroup\", \"actions\").all;\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n const taskGroups = [];\n\n for (let i = 0; i < models.length; i++) {\n if (models[i] instanceof TaskGroupModel) {\n taskGroups.push(models[i]);\n }\n }\n\n this.taskGroupCollection.add(taskGroups);\n }\n\n /**\n */\n get searchLink(): ?LinkModel {\n return this.links.getLinksByGroup(\"search\").first;\n }\n\n /**\n */\n createTaskGroupCollection() {\n this.taskGroupCollection = this.data.taskgroups\n ? this.data.taskgroups\n .map((taskgroup) => {\n const taskgroupContributions = this.contributions.taskgroups.find(\n (taskgroupContribution) =>\n taskgroupContribution.name === taskgroup.name,\n );\n\n if (taskgroupContributions) {\n return TaskGroupModel.create(\n taskgroup.name,\n taskgroup,\n taskgroupContributions,\n );\n }\n\n return null;\n })\n .filter((taskgroup) => taskgroup != null)\n : [];\n }\n\n /**\n * Getting the taskgrouppanels on the tab\n */\n get taskGroupCollection(): TaskGroupCollection {\n return this._taskGroupCollection;\n }\n\n /**\n * Setting the taskgroup panel collection\n */\n set taskGroupCollection(taskgroups: Array<TaskGroupModel>) {\n this._taskGroupCollection = new TaskGroupCollection(taskgroups);\n }\n\n /**\n * Getting the label of the tab\n */\n get label(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n * Getting the component links on the tab\n */\n get components(): LinkCollection {\n return this.links.getLinksByGroup(\"component\", \"search\");\n }\n\n /**\n */\n get actionCollection(): ActionCollection {\n return this._actionCollection;\n }\n\n /**\n * Has component links\n */\n hasComponents(): boolean {\n return this.components.size > 0;\n }\n\n /**\n * Has taskgroups\n */\n hasTaskGroups(): boolean {\n return this.taskGroupCollection && this.taskGroupCollection?.hasItems;\n }\n\n /**\n */\n hasActions(): boolean {\n return this.actionCollection && this.actionCollection.hasItems;\n }\n}\n"],"mappings":";;;;;;;;;;;;AACA,IAAAA,oBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,cAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,eAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,iBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAOA;AACA;AACA;AACe,MAAMI,QAAQ,SAASC,sBAAa,CAAC;EAIlD;AACF;EACEC,WAAWA,CAACC,iBAAoC,EAAE;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAAC,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAEzB,IAAI,CAACC,yBAAyB,CAAC,CAAC;IAEhC,IAAI,CAACC,iBAAiB,GAAG,IAAIC,yBAAgB,CAC3C,IAAI,CAACC,IAAI,CAACC,OAAO,EACjB,IAAI,CAACC,aAAa,CAACD,OACrB,CAAC;EACH;;EAEA;AACF;EACE,IAAIE,IAAIA,CAAA,EAAW;IACjB,OAAO,KAAK;EACd;;EAEA;AACF;EACE,WAAWC,SAASA,CAAA,EAAW;IAC7B,OAAO,UAAU;EACnB;;EAEA;AACF;EACE,OAAOC,iBAAiBA,CAACL,IAAuB,EAAW;IAAA,IAAAM,QAAA,EAAAC,SAAA;IACzD,OACEP,IAAI,CAACE,aAAa,CAACM,YAAY,KAC9B,IAAAC,SAAA,CAAAb,OAAA,EAAAU,QAAA,GAAAN,IAAI,CAACE,aAAa,CAACM,YAAY,EAAAE,IA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I,IAAI,CAACA,gBAAgB,CAACI,QAAQ;EAChE;AACF;AAACE,OAAA,CAAArD,OAAA,GAAAL,QAAA"}
1
+ {"version":3,"file":"TabModel.js","names":["_TaskGroupCollection","_interopRequireDefault","require","_ResourceModel","_TaskGroupModel","_ActionCollection","TabModel","ResourceModel","constructor","modularuiResponse","_defineProperty2","default","createTaskGroupCollection","_actionCollection","ActionCollection","data","actions","contributions","type","modelName","isApplicableModel","_context","_context2","resourcetype","_endsWith","call","getInitialChildModelLinks","links","getLinksByGroup","all","setChildModels","models","taskGroups","i","length","TaskGroupModel","push","taskGroupCollection","add","searchLink","first","_context3","_context4","taskgroups","_filter","_map","taskgroup","_context5","taskgroupContributions","_find","taskgroupContribution","name","create","_taskGroupCollection","TaskGroupCollection","label","getContribution","components","actionCollection","hasComponents","size","hasTaskGroups","hasItems","hasActions","exports"],"sources":["../../../src/models/tab/TabModel.js"],"sourcesContent":["// @flow\nimport TaskGroupCollection from \"../taskgroup/TaskGroupCollection\";\nimport ResourceModel from \"../base/ResourceModel\";\nimport TaskGroupModel from \"../taskgroup/TaskGroupModel\";\nimport ActionCollection from \"../actions/ActionCollection\";\n\nimport type { ModularUIModel } from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type LinkCollection from \"../links/LinkCollection\";\n\n/**\n * Describes a TabModel\n */\nexport default class TabModel extends ResourceModel {\n _actionCollection: ActionCollection;\n _taskGroupCollection: TaskGroupCollection;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this.createTaskGroupCollection();\n\n this._actionCollection = new ActionCollection(\n this.data.actions,\n this.contributions.actions,\n );\n }\n\n /**\n */\n get type(): string {\n return \"Tab\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"TabModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n (data.contributions.resourcetype.endsWith(\"Tab\") ||\n data.contributions.resourcetype.endsWith(\"KnowledgeBank\"))\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this.links.getLinksByGroup(\"taskgroup\", \"actions\").all;\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n const taskGroups = [];\n\n for (let i = 0; i < models.length; i++) {\n if (models[i] instanceof TaskGroupModel) {\n taskGroups.push(models[i]);\n }\n }\n\n this.taskGroupCollection.add(taskGroups);\n }\n\n /**\n */\n get searchLink(): ?LinkModel {\n return this.links.getLinksByGroup(\"search\").first;\n }\n\n /**\n */\n createTaskGroupCollection() {\n this.taskGroupCollection = this.data.taskgroups\n ? this.data.taskgroups\n .map((taskgroup) => {\n const taskgroupContributions = this.contributions.taskgroups.find(\n (taskgroupContribution) =>\n taskgroupContribution.name === taskgroup.name,\n );\n\n if (taskgroupContributions) {\n return TaskGroupModel.create(\n taskgroup.name,\n taskgroup,\n taskgroupContributions,\n );\n }\n\n return null;\n })\n .filter((taskgroup) => taskgroup != null)\n : [];\n }\n\n /**\n * Getting the taskgrouppanels on the tab\n */\n get taskGroupCollection(): TaskGroupCollection {\n return this._taskGroupCollection;\n }\n\n /**\n * Setting the taskgroup panel collection\n */\n set taskGroupCollection(taskgroups: Array<TaskGroupModel>) {\n this._taskGroupCollection = new TaskGroupCollection(taskgroups);\n }\n\n /**\n * Getting the label of the tab\n */\n get label(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n * Getting the component links on the tab\n */\n get components(): LinkCollection {\n return this.links.getLinksByGroup(\"component\", \"search\");\n }\n\n /**\n */\n get actionCollection(): ActionCollection {\n return this._actionCollection;\n }\n\n /**\n * Has component links\n */\n hasComponents(): boolean {\n return this.components.size > 0;\n }\n\n /**\n * Has taskgroups\n */\n hasTaskGroups(): boolean {\n return this.taskGroupCollection && this.taskGroupCollection?.hasItems;\n }\n\n /**\n */\n hasActions(): boolean {\n return this.actionCollection && this.actionCollection.hasItems;\n }\n}\n"],"mappings":";;;;;;;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,SAAS,IAAKA,SAAS,IAAI,IAAI,CAAC,GAC3C,EAAE;EACR;;EAEA;AACF;AACA;EACE,IAAIT,mBAAmBA,CAAA,EAAwB;IAC7C,OAAO,IAAI,CAACgB,oBAAoB;EAClC;;EAEA;AACF;AACA;EACE,IAAIhB,mBAAmBA,CAACM,UAAiC,EAAE;IACzD,IAAI,CAACU,oBAAoB,GAAG,IAAIC,4BAAmB,CAACX,UAAU,CAAC;EACjE;;EAEA;AACF;AACA;EACE,IAAIY,KAAKA,CAAA,EAAW;IAClB,OAAO,IAAI,CAACC,eAAe,CAAC,OAAO,EAAE,EAAE,CAAC;EAC1C;;EAEA;AACF;AACA;EACE,IAAIC,UAAUA,CAAA,EAAmB;IAC/B,OAAO,IAAI,CAAC9B,KAAK,CAACC,eAAe,CAAC,WAAW,EAAE,QAAQ,CAAC;EAC1D;;EAEA;AACF;EACE,IAAI8B,gBAAgBA,CAAA,EAAqB;IACvC,OAAO,IAAI,CAAC7C,iBAAiB;EAC/B;;EAEA;AACF;AACA;EACE8C,aAAaA,CAAA,EAAY;IACvB,OAAO,IAAI,CAACF,UAAU,CAACG,IAAI,GAAG,CAAC;EACjC;;EAEA;AACF;AACA;EACEC,aAAaA,CAAA,EAAY;IACvB,OAAO,IAAI,CAACxB,mBAAmB,IAAI,IAAI,CAACA,mBAAmB,EAAEyB,QAAQ;EACvE;;EAEA;AACF;EACEC,UAAUA,CAAA,EAAY;IACpB,OAAO,IAAI,CAACL,gBAAgB,IAAI,IAAI,CAACA,gBAAgB,CAACI,QAAQ;EAChE;AACF;AAACE,OAAA,CAAArD,OAAA,GAAAL,QAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"TaskGroupCollection.js","names":["_BaseCollection","_interopRequireDefault","require","TaskGroupCollection","BaseCollection","hasTasks","collection","some","taskgroup","exports","default"],"sources":["../../../src/models/taskgroup/TaskGroupCollection.js"],"sourcesContent":["// @flow\nimport BaseCollection from \"../base/BaseCollection\";\n\nimport type TaskGroupModel from \"../taskgroup/TaskGroupModel\";\n\n/**\n * Collection of taskgroup models\n */\nexport default class TaskGroupCollection extends BaseCollection<TaskGroupModel> {\n /**\n * Indicates if the taskgroup collection has has tasks\n */\n hasTasks(): boolean {\n return this.collection.some((taskgroup) => taskgroup.hasTasks());\n }\n}\n"],"mappings":";;;;;;;AACA,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA;AAIA;AACA;AACA;AACe,MAAMC,mBAAmB,SAASC,uBAAc,CAAiB;EAC9E;AACF;AACA;EACEC,QAAQA,CAAA,EAAY;IAClB,OAAO,IAAI,CAACC,UAAU,CAACC,IAAI,CAAEC,SAAS,IAAKA,SAAS,CAACH,QAAQ,CAAC,CAAC,CAAC;EAClE;AACF;AAACI,OAAA,CAAAC,OAAA,GAAAP,mBAAA"}
1
+ {"version":3,"file":"TaskGroupCollection.js","names":["_BaseCollection","_interopRequireDefault","require","TaskGroupCollection","BaseCollection","hasTasks","collection","some","taskgroup","exports","default"],"sources":["../../../src/models/taskgroup/TaskGroupCollection.js"],"sourcesContent":["// @flow\nimport BaseCollection from \"../base/BaseCollection\";\n\nimport type TaskGroupModel from \"../taskgroup/TaskGroupModel\";\n\n/**\n * Collection of taskgroup models\n */\nexport default class TaskGroupCollection extends BaseCollection<TaskGroupModel> {\n /**\n * Indicates if the taskgroup collection has has tasks\n */\n hasTasks(): boolean {\n return this.collection.some((taskgroup) => taskgroup.hasTasks());\n }\n}\n"],"mappings":";;;;;;;AACA,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA;AAIA;AACA;AACA;AACe,MAAMC,mBAAmB,SAASC,uBAAc,CAAiB;EAC9E;AACF;AACA;EACEC,QAAQA,CAAA,EAAY;IAClB,OAAO,IAAI,CAACC,UAAU,CAACC,IAAI,CAAEC,SAAS,IAAKA,SAAS,CAACH,QAAQ,CAAC,CAAC,CAAC;EAClE;AACF;AAACI,OAAA,CAAAC,OAAA,GAAAP,mBAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"TaskGroupModel.js","names":["_ActionCollection","_interopRequireDefault","require","_ResourceModel","_ModularUIResponse","TaskGroupModel","ResourceModel","constructor","modularuiResponse","_defineProperty2","default","_actionCollection","ActionCollection","data","actions","contributions","selfHref","links","getLinkByKey","selflink","href","_key","substring","lastIndexOf","name","create","key","taskgroup","ModularUIResponse","type","modelName","isApplicableModel","resourcetype","label","actionCollection","hasTasks","length","exports"],"sources":["../../../src/models/taskgroup/TaskGroupModel.js"],"sourcesContent":["// @flow\nimport ActionCollection from \"../actions/ActionCollection\";\nimport ResourceModel from \"../base/ResourceModel\";\n\nimport ModularUIResponse from \"../../modularui/ModularUIResponse\";\n\n/**\n * TaskGroupModel\n */\nexport default class TaskGroupModel extends ResourceModel {\n _key: string;\n _actionCollection: ActionCollection;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._actionCollection = new ActionCollection(\n this.data.actions,\n this.contributions.actions,\n );\n\n const selfHref = this.links.getLinkByKey(\"self\")\n ? this.selflink.href.href\n : null;\n\n this._key = selfHref\n ? selfHref.substring(selfHref.lastIndexOf(\"/\") + 1)\n : this.data.name;\n }\n\n /**\n */\n static create(\n key: string,\n data: Object,\n contributions: Object,\n ): TaskGroupModel {\n const taskgroup = new ModularUIResponse();\n taskgroup.key = key;\n taskgroup.data = data;\n taskgroup.contributions = contributions;\n\n return new TaskGroupModel(taskgroup);\n }\n\n /**\n */\n get type(): string {\n return \"TaskGroup\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"TaskGroupModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"TaskGroup\"\n );\n }\n\n /**\n * Get the key of the TaskGroup\n */\n get key(): string {\n return this._key;\n }\n\n /**\n * Get the label of the TaskGroup\n */\n get label(): string {\n return this.contributions.label;\n }\n\n /**\n * Retrieve actions of taskgroup\n */\n get actionCollection(): ActionCollection {\n return this._actionCollection;\n }\n\n /**\n * Indicates if taskgroup has tasks\n * @returns {boolean}\n */\n hasTasks(): boolean {\n return this.actionCollection.length > 0;\n }\n}\n"],"mappings":";;;;;;;;AACA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,cAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,kBAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEA;AACA;AACA;AACe,MAAMG,cAAc,SAASC,sBAAa,CAAC;EAIxD;AACF;EACEC,WAAWA,CAACC,iBAAoC,EAAE;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAAC,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAEzB,IAAI,CAACC,iBAAiB,GAAG,IAAIC,yBAAgB,CAC3C,IAAI,CAACC,IAAI,CAACC,OAAO,EACjB,IAAI,CAACC,aAAa,CAACD,OACrB,CAAC;IAED,MAAME,QAAQ,GAAG,IAAI,CAACC,KAAK,CAACC,YAAY,CAAC,MAAM,CAAC,GAC5C,IAAI,CAACC,QAAQ,CAACC,IAAI,CAACA,IAAI,GACvB,IAAI;IAER,IAAI,CAACC,IAAI,GAAGL,QAAQ,GAChBA,QAAQ,CAACM,SAAS,CAACN,QAAQ,CAACO,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GACjD,IAAI,CAACV,IAAI,CAACW,IAAI;EACpB;;EAEA;AACF;EACE,OAAOC,MAAMA,CACXC,GAAW,EACXb,IAAY,EACZE,aAAqB,EACL;IAChB,MAAMY,SAAS,GAAG,IAAIC,0BAAiB,CAAC,CAAC;IACzCD,SAAS,CAACD,GAAG,GAAGA,GAAG;IACnBC,SAAS,CAACd,IAAI,GAAGA,IAAI;IACrBc,SAAS,CAACZ,aAAa,GAAGA,aAAa;IAEvC,OAAO,IAAIV,cAAc,CAACsB,SAAS,CAAC;EACtC;;EAEA;AACF;EACE,IAAIE,IAAIA,CAAA,EAAW;IACjB,OAAO,WAAW;EACpB;;EAEA;AACF;EACE,WAAWC,SAASA,CAAA,EAAW;IAC7B,OAAO,gBAAgB;EACzB;;EAEA;AACF;EACE,OAAOC,iBAAiBA,CAAClB,IAAuB,EAAW;IACzD,OACEA,IAAI,CAACE,aAAa,CAACiB,YAAY,IAC/BnB,IAAI,CAACE,aAAa,CAACiB,YAAY,KAAK,WAAW;EAEnD;;EAEA;AACF;AACA;EACE,IAAIN,GAAGA,CAAA,EAAW;IAChB,OAAO,IAAI,CAACL,IAAI;EAClB;;EAEA;AACF;AACA;EACE,IAAIY,KAAKA,CAAA,EAAW;IAClB,OAAO,IAAI,CAAClB,aAAa,CAACkB,KAAK;EACjC;;EAEA;AACF;AACA;EACE,IAAIC,gBAAgBA,CAAA,EAAqB;IACvC,OAAO,IAAI,CAACvB,iBAAiB;EAC/B;;EAEA;AACF;AACA;AACA;EACEwB,QAAQA,CAAA,EAAY;IAClB,OAAO,IAAI,CAACD,gBAAgB,CAACE,MAAM,GAAG,CAAC;EACzC;AACF;AAACC,OAAA,CAAA3B,OAAA,GAAAL,cAAA"}
1
+ {"version":3,"file":"TaskGroupModel.js","names":["_ActionCollection","_interopRequireDefault","require","_ResourceModel","_ModularUIResponse","TaskGroupModel","ResourceModel","constructor","modularuiResponse","_defineProperty2","default","_actionCollection","ActionCollection","data","actions","contributions","selfHref","links","getLinkByKey","selflink","href","_key","substring","lastIndexOf","name","create","key","taskgroup","ModularUIResponse","type","modelName","isApplicableModel","resourcetype","label","actionCollection","hasTasks","length","exports"],"sources":["../../../src/models/taskgroup/TaskGroupModel.js"],"sourcesContent":["// @flow\nimport ActionCollection from \"../actions/ActionCollection\";\nimport ResourceModel from \"../base/ResourceModel\";\n\nimport ModularUIResponse from \"../../modularui/ModularUIResponse\";\n\n/**\n * TaskGroupModel\n */\nexport default class TaskGroupModel extends ResourceModel {\n _key: string;\n _actionCollection: ActionCollection;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._actionCollection = new ActionCollection(\n this.data.actions,\n this.contributions.actions,\n );\n\n const selfHref = this.links.getLinkByKey(\"self\")\n ? this.selflink.href.href\n : null;\n\n this._key = selfHref\n ? selfHref.substring(selfHref.lastIndexOf(\"/\") + 1)\n : this.data.name;\n }\n\n /**\n */\n static create(\n key: string,\n data: Object,\n contributions: Object,\n ): TaskGroupModel {\n const taskgroup = new ModularUIResponse();\n taskgroup.key = key;\n taskgroup.data = data;\n taskgroup.contributions = contributions;\n\n return new TaskGroupModel(taskgroup);\n }\n\n /**\n */\n get type(): string {\n return \"TaskGroup\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"TaskGroupModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"TaskGroup\"\n );\n }\n\n /**\n * Get the key of the TaskGroup\n */\n get key(): string {\n return this._key;\n }\n\n /**\n * Get the label of the TaskGroup\n */\n get label(): string {\n return this.contributions.label;\n }\n\n /**\n * Retrieve actions of taskgroup\n */\n get actionCollection(): ActionCollection {\n return this._actionCollection;\n }\n\n /**\n * Indicates if taskgroup has tasks\n * @returns {boolean}\n */\n hasTasks(): boolean {\n return this.actionCollection.length > 0;\n }\n}\n"],"mappings":";;;;;;;;AACA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,cAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,kBAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEA;AACA;AACA;AACe,MAAMG,cAAc,SAASC,sBAAa,CAAC;EAIxD;AACF;EACEC,WAAWA,CAACC,iBAAoC,EAAE;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAAC,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAEzB,IAAI,CAACC,iBAAiB,GAAG,IAAIC,yBAAgB,CAC3C,IAAI,CAACC,IAAI,CAACC,OAAO,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ACEwB,QAAQA,CAAA,EAAY;IAClB,OAAO,IAAI,CAACD,gBAAgB,CAACE,MAAM,GAAG,CAAC;EACzC;AACF;AAACC,OAAA,CAAA3B,OAAA,GAAAL,cAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../src/models/types.js"],"sourcesContent":["// @flow\nimport type ApplicationModel from \"./application/ApplicationModel\";\nimport type BooleanAttributeModel from \"./attributes/BooleanAttributeModel\";\nimport type CaptchaAttributeModel from \"./attributes/CaptchaAttributeModel\";\nimport type ChoiceAttributeModel from \"./attributes/ChoiceAttributeModel\";\nimport type CompositeAttributeModel from \"./attributes/CompositeAttributeModel\";\nimport type DatetimeAttributeModel from \"./attributes/DatetimeAttributeModel\";\nimport type HelptextAttributeModel from \"./attributes/HelptextAttributeModel\";\nimport type LabelAttributeModel from \"./attributes/LabelAttributeModel\";\nimport type MemoAttributeModel from \"./attributes/MemoAttributeModel\";\nimport type MoneyAttributeModel from \"./attributes/MoneyAttributeModel\";\nimport type NumberAttributeModel from \"./attributes/NumberAttributeModel\";\nimport type PasswordAttributeModel from \"./attributes/PasswordAttributeModel\";\nimport type StringAttributeModel from \"./attributes/StringAttributeModel\";\nimport type UploadAttributeModel from \"./attributes/UploadAttributeModel\";\nimport type XMLAttributeModel from \"./attributes/XMLAttributeModel\";\nimport type CaseViewModel from \"./caseview/CaseViewModel\";\nimport type BusinessScenarioModel from \"./concepts/BusinessScenarioModel\";\nimport type ConceptDetailModel from \"./concepts/ConceptDetailModel\";\nimport type ConceptIndexModel from \"./concepts/ConceptIndexModel\";\nimport type ConceptTypeDetailModel from \"./concepts/ConceptTypeDetailModel\";\nimport type ContentIndexModel from \"./content/ContentIndexModel\";\nimport type ContentModel from \"./content/ContentModel\";\nimport type SectionModel from \"./content/SectionModel\";\nimport type ContentTOCModel from \"./content/ContentTOCModel\";\nimport type ContentTypeModel from \"./content/ContentTypeModel\";\nimport type DetailModel from \"./detail/DetailModel\";\nimport type AssignmentFilterModel from \"./filters/AssignmentFilterModel\";\nimport type FilterModel from \"./filters/FilterModel\";\nimport type RangeFilterModel from \"./filters/RangeFilterModel\";\nimport type ConceptIndexFilterModel from \"./filters/ConceptIndexFilterModel\";\nimport type FormModel from \"./form/FormModel\";\nimport type ListDetailModel from \"./list/ListDetailModel\";\nimport type ListModel from \"./list/ListModel\";\nimport type ModelCatalogModel from \"./modelcatalog/ModelCatalogModel\";\nimport type GroupingPanelModel from \"./panels/GroupingPanelModel\";\nimport type CaseSearchModel from \"./search/CaseSearchModel\";\nimport type TabModel from \"./tab/TabModel\";\nimport type TaskGroupModel from \"./taskgroup/TaskGroupModel\";\nimport type UserModel from \"./user/UserModel\";\nimport type UserServicesModel from \"./user/UserServicesModel\";\nimport type LinkModel from \"./links/LinkModel\";\nimport type LookupOptionsModel from \"./lookup/LookupOptionsModel\";\nimport type BaseFilterModel from \"./filters/BaseFilterModel\";\nimport type AttributeCollection from \"./attributes/AttributeCollection\";\nimport type AttributeModel from \"./attributes/AttributeModel\";\nimport type LayoutHintCollection from \"./layouthint/LayoutHintCollection\";\n\nexport type ModularUIModel =\n | ApplicationModel\n | CaseSearchModel\n | CaseViewModel\n | ListDetailModel\n | DetailModel\n | FormModel\n | GroupingPanelModel\n | ListModel\n | TabModel\n | TaskGroupModel\n | UserModel\n | UserServicesModel\n | ModelCatalogModel\n | ConceptIndexModel\n | ConceptDetailModel\n | BusinessScenarioModel\n | ConceptTypeDetailModel\n | ContentIndexModel\n | ContentTOCModel\n | ContentModel\n | ContentTypeModel\n | LookupOptionsModel;\n\nexport type AttributeType =\n | BooleanAttributeModel\n | CaptchaAttributeModel\n | ChoiceAttributeModel\n | DatetimeAttributeModel\n | HelptextAttributeModel\n | LabelAttributeModel\n | MemoAttributeModel\n | MoneyAttributeModel\n | NumberAttributeModel\n | PasswordAttributeModel\n | CompositeAttributeModel\n | StringAttributeModel\n | UploadAttributeModel\n | XMLAttributeModel;\n\nexport type RangeChildAttributeType =\n | NumberAttributeModel\n | DatetimeAttributeModel;\n\nexport type FilterType =\n | BaseFilterModel\n | FilterModel\n | AssignmentFilterModel\n | RangeFilterModel\n | ConceptIndexFilterModel;\n\nexport type FormErrorAnchor = {\n id: string,\n properties?: {\n [propertyName: string]: string | number,\n },\n anchor?: {\n objectid: string,\n elementid?: string,\n _links?: Object,\n index?: number,\n \"index-identifier\"?: string,\n },\n layouthint: LayoutHintCollection,\n message: string,\n param?: {\n name: string,\n },\n};\n\nexport type labelsJSON = {\n _id: string,\n label: string,\n value: string,\n};\n\nexport type propertyJSON = {\n _id: string,\n type: string,\n mandatory: string,\n label: string,\n value: string,\n};\n\nexport type textfragmentJSON = {\n label: string,\n text: string,\n type: string,\n};\n\nexport interface IConstraintModel {\n +id: string;\n +defaultMessage: string;\n +parameters: Object;\n +isMandatoryConstraint: boolean;\n validate(value: any): boolean;\n hasValidation(): boolean;\n}\n\nexport interface ILayoutHintRule {\n process(attribute: AttributeModel, attributes: AttributeCollection): void;\n}\n\nexport interface IModelWithChildModels {\n getInitialChildModelLinks(): Array<LinkModel>;\n setChildModels(models: Array<ModularUIModel>): void;\n}\n\nexport type AuthenticationType = {\n name: string,\n authentication: string,\n redirectUri?: string,\n isPrimary: boolean,\n};\n\nexport type FileEntryType = {\n name: string,\n size?: number,\n progress: number,\n error?: string,\n token?: string,\n};\n\nexport type FilesType = {\n [filename: string]: FileEntryType,\n};\n\nexport type FiletypeConstraintsType = Array<{|\n extensions: Array<string>,\n mimeTypes: Array<string>,\n|}>;\n\nexport type FilesizeConstraintsType = {\n fileSize: ?number,\n maxTotalFileSize: ?number,\n isMaxTotal: boolean,\n};\n\nexport type PropertyData = { type: string, label: string, value: string };\nexport type TextFragmentData = {\n type: string,\n label: string,\n text: string | { id?: string, message: string, properties?: Object },\n};\nexport type SectionData = {\n id: string,\n type: string,\n label?: string,\n number?: string,\n body: string | { id?: string, message: string, properties?: Object },\n _links: { self: { href: string } },\n childSections: Array<SectionData>,\n subSections: Array<SectionData>,\n};\n\nexport type PropertyElement = {\n propertyElement: {\n label: string,\n layouthint: Array<string>,\n properties: Array<PropertyData>,\n },\n};\nexport type TextFragmentElement = {\n textFragmentElement: {\n label: string,\n layouthint: Array<string>,\n textfragments: Array<TextFragmentData>,\n },\n};\nexport type ContentElement = {\n contentElement: {\n label: string,\n layouthint: Array<string>,\n sections: Array<SectionData>,\n },\n};\n\nexport type PropertyElementMapped = {\n propertyElement: {\n label: string,\n layouthint: LayoutHintCollection,\n properties: Array<PropertyData>,\n },\n};\nexport type TextFragmentElementMapped = {\n textFragmentElement: {\n label: string,\n layouthint: LayoutHintCollection,\n textfragments: Array<TextFragmentData>,\n },\n};\nexport type ContentElementMapped = {\n contentElement: {\n label: string,\n layouthint: LayoutHintCollection,\n sections: Array<SectionModel>,\n },\n};\n\nexport type ContentAll = Array<\n PropertyElementMapped | TextFragmentElementMapped | ContentElementMapped,\n>;\n\nexport type ContentData = {\n header: {\n label?: string,\n description?: { id?: string, message: string, properties?: Object },\n },\n label?: string,\n elements: Array<PropertyElement | TextFragmentElement | ContentElement>,\n};\n"],"mappings":""}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../src/models/types.js"],"sourcesContent":["// @flow\nimport type ApplicationModel from \"./application/ApplicationModel\";\nimport type BooleanAttributeModel from \"./attributes/BooleanAttributeModel\";\nimport type CaptchaAttributeModel from \"./attributes/CaptchaAttributeModel\";\nimport type ChoiceAttributeModel from \"./attributes/ChoiceAttributeModel\";\nimport type CompositeAttributeModel from \"./attributes/CompositeAttributeModel\";\nimport type DatetimeAttributeModel from \"./attributes/DatetimeAttributeModel\";\nimport type HelptextAttributeModel from \"./attributes/HelptextAttributeModel\";\nimport type LabelAttributeModel from \"./attributes/LabelAttributeModel\";\nimport type MemoAttributeModel from \"./attributes/MemoAttributeModel\";\nimport type MoneyAttributeModel from \"./attributes/MoneyAttributeModel\";\nimport type NumberAttributeModel from \"./attributes/NumberAttributeModel\";\nimport type PasswordAttributeModel from \"./attributes/PasswordAttributeModel\";\nimport type StringAttributeModel from \"./attributes/StringAttributeModel\";\nimport type UploadAttributeModel from \"./attributes/UploadAttributeModel\";\nimport type XMLAttributeModel from \"./attributes/XMLAttributeModel\";\nimport type CaseViewModel from \"./caseview/CaseViewModel\";\nimport type BusinessScenarioModel from \"./concepts/BusinessScenarioModel\";\nimport type ConceptDetailModel from \"./concepts/ConceptDetailModel\";\nimport type ConceptIndexModel from \"./concepts/ConceptIndexModel\";\nimport type ConceptTypeDetailModel from \"./concepts/ConceptTypeDetailModel\";\nimport type ContentIndexModel from \"./content/ContentIndexModel\";\nimport type ContentModel from \"./content/ContentModel\";\nimport type SectionModel from \"./content/SectionModel\";\nimport type ContentTOCModel from \"./content/ContentTOCModel\";\nimport type ContentTypeModel from \"./content/ContentTypeModel\";\nimport type DetailModel from \"./detail/DetailModel\";\nimport type AssignmentFilterModel from \"./filters/AssignmentFilterModel\";\nimport type FilterModel from \"./filters/FilterModel\";\nimport type RangeFilterModel from \"./filters/RangeFilterModel\";\nimport type ConceptIndexFilterModel from \"./filters/ConceptIndexFilterModel\";\nimport type FormModel from \"./form/FormModel\";\nimport type ListDetailModel from \"./list/ListDetailModel\";\nimport type ListModel from \"./list/ListModel\";\nimport type ModelCatalogModel from \"./modelcatalog/ModelCatalogModel\";\nimport type GroupingPanelModel from \"./panels/GroupingPanelModel\";\nimport type CaseSearchModel from \"./search/CaseSearchModel\";\nimport type TabModel from \"./tab/TabModel\";\nimport type TaskGroupModel from \"./taskgroup/TaskGroupModel\";\nimport type UserModel from \"./user/UserModel\";\nimport type UserServicesModel from \"./user/UserServicesModel\";\nimport type LinkModel from \"./links/LinkModel\";\nimport type LookupOptionsModel from \"./lookup/LookupOptionsModel\";\nimport type BaseFilterModel from \"./filters/BaseFilterModel\";\nimport type AttributeCollection from \"./attributes/AttributeCollection\";\nimport type AttributeModel from \"./attributes/AttributeModel\";\nimport type LayoutHintCollection from \"./layouthint/LayoutHintCollection\";\n\nexport type ModularUIModel =\n | ApplicationModel\n | CaseSearchModel\n | CaseViewModel\n | ListDetailModel\n | DetailModel\n | FormModel\n | GroupingPanelModel\n | ListModel\n | TabModel\n | TaskGroupModel\n | UserModel\n | UserServicesModel\n | ModelCatalogModel\n | ConceptIndexModel\n | ConceptDetailModel\n | BusinessScenarioModel\n | ConceptTypeDetailModel\n | ContentIndexModel\n | ContentTOCModel\n | ContentModel\n | ContentTypeModel\n | LookupOptionsModel;\n\nexport type AttributeType =\n | BooleanAttributeModel\n | CaptchaAttributeModel\n | ChoiceAttributeModel\n | DatetimeAttributeModel\n | HelptextAttributeModel\n | LabelAttributeModel\n | MemoAttributeModel\n | MoneyAttributeModel\n | NumberAttributeModel\n | PasswordAttributeModel\n | CompositeAttributeModel\n | StringAttributeModel\n | UploadAttributeModel\n | XMLAttributeModel;\n\nexport type RangeChildAttributeType =\n | NumberAttributeModel\n | DatetimeAttributeModel;\n\nexport type FilterType =\n | BaseFilterModel\n | FilterModel\n | AssignmentFilterModel\n | RangeFilterModel\n | ConceptIndexFilterModel;\n\nexport type FormErrorAnchor = {\n id: string,\n properties?: {\n [propertyName: string]: string | number,\n },\n anchor?: {\n objectid: string,\n elementid?: string,\n _links?: Object,\n index?: number,\n \"index-identifier\"?: string,\n },\n layouthint: LayoutHintCollection,\n message: string,\n param?: {\n name: string,\n },\n};\n\nexport type labelsJSON = {\n _id: string,\n label: string,\n value: string,\n};\n\nexport type propertyJSON = {\n _id: string,\n type: string,\n mandatory: string,\n label: string,\n value: string,\n};\n\nexport type textfragmentJSON = {\n label: string,\n text: string,\n type: string,\n};\n\nexport interface IConstraintModel {\n +id: string;\n +defaultMessage: string;\n +parameters: Object;\n +isMandatoryConstraint: boolean;\n validate(value: any): boolean;\n hasValidation(): boolean;\n}\n\nexport interface ILayoutHintRule {\n process(attribute: AttributeModel, attributes: AttributeCollection): void;\n}\n\nexport interface IModelWithChildModels {\n getInitialChildModelLinks(): Array<LinkModel>;\n setChildModels(models: Array<ModularUIModel>): void;\n}\n\nexport type AuthenticationType = {\n name: string,\n authentication: string,\n redirectUri?: string,\n isPrimary: boolean,\n};\n\nexport type FileEntryType = {\n name: string,\n size?: number,\n progress: number,\n error?: string,\n token?: string,\n};\n\nexport type FilesType = {\n [filename: string]: FileEntryType,\n};\n\nexport type FiletypeConstraintsType = Array<{|\n extensions: Array<string>,\n mimeTypes: Array<string>,\n|}>;\n\nexport type FilesizeConstraintsType = {\n fileSize: ?number,\n maxTotalFileSize: ?number,\n isMaxTotal: boolean,\n};\n\nexport type PropertyData = { type: string, label: string, value: string };\nexport type TextFragmentData = {\n type: string,\n label: string,\n text: string | { id?: string, message: string, properties?: Object },\n};\nexport type SectionData = {\n id: string,\n type: string,\n label?: string,\n number?: string,\n body: string | { id?: string, message: string, properties?: Object },\n _links: { self: { href: string } },\n childSections: Array<SectionData>,\n subSections: Array<SectionData>,\n};\n\nexport type PropertyElement = {\n propertyElement: {\n label: string,\n layouthint: Array<string>,\n properties: Array<PropertyData>,\n },\n};\nexport type TextFragmentElement = {\n textFragmentElement: {\n label: string,\n layouthint: Array<string>,\n textfragments: Array<TextFragmentData>,\n },\n};\nexport type ContentElement = {\n contentElement: {\n label: string,\n layouthint: Array<string>,\n sections: Array<SectionData>,\n },\n};\n\nexport type PropertyElementMapped = {\n propertyElement: {\n label: string,\n layouthint: LayoutHintCollection,\n properties: Array<PropertyData>,\n },\n};\nexport type TextFragmentElementMapped = {\n textFragmentElement: {\n label: string,\n layouthint: LayoutHintCollection,\n textfragments: Array<TextFragmentData>,\n },\n};\nexport type ContentElementMapped = {\n contentElement: {\n label: string,\n layouthint: LayoutHintCollection,\n sections: Array<SectionModel>,\n },\n};\n\nexport type ContentAll = Array<\n PropertyElementMapped | TextFragmentElementMapped | ContentElementMapped,\n>;\n\nexport type ContentData = {\n header: {\n label?: string,\n description?: { id?: string, message: string, properties?: Object },\n },\n label?: string,\n elements: Array<PropertyElement | TextFragmentElement | ContentElement>,\n};\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"UserModel.js","names":["_ResourceModel","_interopRequireDefault","require","UserModel","ResourceModel","type","modelName","isApplicableModel","data","contributions","resourcetype","avatar","Avatar","username","Username","fullname","Fullname","label","exports","default"],"sources":["../../../src/models/user/UserModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\n\n/**\n * User model\n */\nexport default class UserModel extends ResourceModel {\n /**\n */\n get type(): string {\n return \"User\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"UserModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"userdata\"\n );\n }\n\n /**\n * Retrieve username of user\n */\n get avatar(): string {\n return this.data.Avatar;\n }\n\n /**\n * Retrieve username of user\n */\n get username(): string {\n return this.data.Username || \"Guest\";\n }\n\n /**\n * retrieve the fullname of the user\n */\n get fullname(): string {\n return this.data.Fullname || \"Guest\";\n }\n\n /**\n */\n get label(): string {\n return this.contributions.label;\n }\n}\n"],"mappings":";;;;;;;AACA,IAAAA,cAAA,GAAAC,sBAAA,CAAAC,OAAA;AAIA;AACA;AACA;AACe,MAAMC,SAAS,SAASC,sBAAa,CAAC;EACnD;AACF;EACE,IAAIC,IAAIA,CAAA,EAAW;IACjB,OAAO,MAAM;EACf;;EAEA;AACF;EACE,WAAWC,SAASA,CAAA,EAAW;IAC7B,OAAO,WAAW;EACpB;;EAEA;AACF;EACE,OAAOC,iBAAiBA,CAACC,IAAuB,EAAW;IACzD,OACEA,IAAI,CAACC,aAAa,CAACC,YAAY,IAC/BF,IAAI,CAACC,aAAa,CAACC,YAAY,KAAK,UAAU;EAElD;;EAEA;AACF;AACA;EACE,IAAIC,MAAMA,CAAA,EAAW;IACnB,OAAO,IAAI,CAACH,IAAI,CAACI,MAAM;EACzB;;EAEA;AACF;AACA;EACE,IAAIC,QAAQA,CAAA,EAAW;IACrB,OAAO,IAAI,CAACL,IAAI,CAACM,QAAQ,IAAI,OAAO;EACtC;;EAEA;AACF;AACA;EACE,IAAIC,QAAQA,CAAA,EAAW;IACrB,OAAO,IAAI,CAACP,IAAI,CAACQ,QAAQ,IAAI,OAAO;EACtC;;EAEA;AACF;EACE,IAAIC,KAAKA,CAAA,EAAW;IAClB,OAAO,IAAI,CAACR,aAAa,CAACQ,KAAK;EACjC;AACF;AAACC,OAAA,CAAAC,OAAA,GAAAhB,SAAA"}
1
+ {"version":3,"file":"UserModel.js","names":["_ResourceModel","_interopRequireDefault","require","UserModel","ResourceModel","type","modelName","isApplicableModel","data","contributions","resourcetype","avatar","Avatar","username","Username","fullname","Fullname","label","exports","default"],"sources":["../../../src/models/user/UserModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\n\n/**\n * User model\n */\nexport default class UserModel extends ResourceModel {\n /**\n */\n get type(): string {\n return \"User\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"UserModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"userdata\"\n );\n }\n\n /**\n * Retrieve username of user\n */\n get avatar(): string {\n return this.data.Avatar;\n }\n\n /**\n * Retrieve username of user\n */\n get username(): string {\n return this.data.Username || \"Guest\";\n }\n\n /**\n * retrieve the fullname of the user\n */\n get fullname(): string {\n return this.data.Fullname || \"Guest\";\n }\n\n /**\n */\n get label(): string {\n return this.contributions.label;\n }\n}\n"],"mappings":";;;;;;;AACA,IAAAA,cAAA,GAAAC,sBAAA,CAAAC,OAAA;AAIA;AACA;AACA;AACe,MAAMC,SAAS,SAASC,sBAAa,CAAC;EACnD;AACF;EACE,IAAIC,IAAIA,CAAA,EAAW;IACjB,OAAO,MAAM;EACf;;EAEA;AACF;EACE,WAAWC,SAASA,CAAA,EAAW;IAC7B,OAAO,WAAW;EACpB;;EAEA;AACF;EACE,OAAOC,iBAAiBA,CAACC,IAAuB,EAAW;IACzD,OACEA,IAAI,CAACC,aAAa,CAACC,YAAY,IAC/BF,IAAI,CAACC,aAAa,CAACC,YAAY,KAAK,UAAU;EAElD;;EAEA;AACF;AACA;EACE,IAAIC,MAAMA,CAAA,EAAW;IACnB,OAAO,IAAI,CAACH,IAAI,CAACI,MAAM;EACzB;;EAEA;AACF;AACA;EACE,IAAIC,QAAQA,CAAA,EAAW;IACrB,OAAO,IAAI,CAACL,IAAI,CAACM,QAAQ,IAAI,OAAO;EACtC;;EAEA;AACF;AACA;EACE,IAAIC,QAAQA,CAAA,EAAW;IACrB,OAAO,IAAI,CAACP,IAAI,CAACQ,QAAQ,IAAI,OAAO;EACtC;;EAEA;AACF;EACE,IAAIC,KAAKA,CAAA,EAAW;IAClB,OAAO,IAAI,CAACR,aAAa,CAACQ,KAAK;EACjC;AACF;AAACC,OAAA,CAAAC,OAAA,GAAAhB,SAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"UserProfileModel.js","names":["_objects","require","_AttributeCollection","_interopRequireDefault","_UserModel","UserProfileModel","UserModel","constructor","modularuiResponse","_context","_defineProperty2","default","attributeContributions","contributions","attributes","_filter","call","contribution","key","_keys","has","data","_attributeCollection","AttributeCollection","type","attributeCollection","modelName","exports"],"sources":["../../../src/models/user/UserProfileModel.js"],"sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\n\nimport AttributeCollection from \"../attributes/AttributeCollection\";\n\nimport UserModel from \"./UserModel\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\n\n/**\n * User model\n */\nexport default class UserProfileModel extends UserModel {\n _attributeCollection: AttributeCollection;\n\n /**\n * constructor\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n const attributeContributions = this.contributions.attributes\n ? this.contributions.attributes.filter((contribution) => {\n const [key] = Object.keys(contribution);\n return key !== \"sessiondata\" && has(this.data, key);\n })\n : [];\n\n this._attributeCollection = new AttributeCollection(\n this.data,\n attributeContributions,\n );\n }\n\n /**\n */\n get type(): string {\n return \"UserProfile\";\n }\n\n /**\n * returns all the attributes from the attribute collection\n */\n get attributeCollection(): AttributeCollection {\n return this._attributeCollection;\n }\n\n /**\n */\n static get modelName(): string {\n return \"UserProfileModel\";\n }\n}\n"],"mappings":";;;;;;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AAEA,IAAAC,oBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,UAAA,GAAAD,sBAAA,CAAAF,OAAA;AAIA;AACA;AACA;AACe,MAAMI,gBAAgB,SAASC,kBAAS,CAAC;EAGtD;AACF;AACA;EACEC,WAAWA,CAACC,iBAAoC,EAAE;IAAA,IAAAC,QAAA;IAChD,KAAK,CAACD,iBAAiB,CAAC;IAAC,IAAAE,gBAAA,CAAAC,OAAA;IAEzB,MAAMC,sBAAsB,GAAG,IAAI,CAACC,aAAa,CAACC,UAAU,GACxD,IAAAC,OAAA,CAAAJ,OAAA,EAAAF,QAAA,OAAI,CAACI,aAAa,CAACC,UAAU,EAAAE,IAAA,CAAAP,QAAA,EAASQ,YAAY,IAAK;MACrD,MAAM,CAACC,GAAG,CAAC,GAAG,IAAAC,KAAA,CAAAR,OAAA,EAAYM,YAAY,CAAC;MACvC,OAAOC,GAAG,KAAK,aAAa,IAAI,IAAAE,YAAG,EAAC,IAAI,CAACC,IAAI,EAAEH,GAAG,CAAC;IACrD,CAAC,CAAC,GACF,EAAE;IAEN,IAAI,CAACI,oBAAoB,GAAG,IAAIC,4BAAmB,CACjD,IAAI,CAACF,IAAI,EACTT,sBACF,CAAC;EACH;;EAEA;AACF;EACE,IAAIY,IAAIA,CAAA,EAAW;IACjB,OAAO,aAAa;EACtB;;EAEA;AACF;AACA;EACE,IAAIC,mBAAmBA,CAAA,EAAwB;IAC7C,OAAO,IAAI,CAACH,oBAAoB;EAClC;;EAEA;AACF;EACE,WAAWI,SAASA,CAAA,EAAW;IAC7B,OAAO,kBAAkB;EAC3B;AACF;AAACC,OAAA,CAAAhB,OAAA,GAAAN,gBAAA"}
1
+ {"version":3,"file":"UserProfileModel.js","names":["_objects","require","_AttributeCollection","_interopRequireDefault","_UserModel","UserProfileModel","UserModel","constructor","modularuiResponse","_context","_defineProperty2","default","attributeContributions","contributions","attributes","_filter","call","contribution","key","_keys","has","data","_attributeCollection","AttributeCollection","type","attributeCollection","modelName","exports"],"sources":["../../../src/models/user/UserProfileModel.js"],"sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\n\nimport AttributeCollection from \"../attributes/AttributeCollection\";\n\nimport UserModel from \"./UserModel\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\n\n/**\n * User model\n */\nexport default class UserProfileModel extends UserModel {\n _attributeCollection: AttributeCollection;\n\n /**\n * constructor\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n const attributeContributions = this.contributions.attributes\n ? this.contributions.attributes.filter((contribution) => {\n const [key] = Object.keys(contribution);\n return key !== \"sessiondata\" && has(this.data, key);\n })\n : [];\n\n this._attributeCollection = new AttributeCollection(\n this.data,\n attributeContributions,\n );\n }\n\n /**\n */\n get type(): string {\n return \"UserProfile\";\n }\n\n /**\n * returns all the attributes from the attribute collection\n */\n get attributeCollection(): AttributeCollection {\n return this._attributeCollection;\n }\n\n /**\n */\n static get modelName(): string {\n return \"UserProfileModel\";\n }\n}\n"],"mappings":";;;;;;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AAEA,IAAAC,oBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,UAAA,GAAAD,sBAAA,CAAAF,OAAA;AAIA;AACA;AACA;AACe,MAAMI,gBAAgB,SAASC,kBAAS,CAAC;EAGtD;AACF;AACA;EACEC,WAAWA,CAACC,iBAAoC,EAAE;IAAA,IAAAC,QAAA;IAChD,KAAK,CAACD,iBAAiB,CAAC;IAAC,IAAAE,gBAAA,CAAAC,OAAA;IAEzB,MAAMC,sBAAsB,GAAG,IAAI,CAACC,aAAa,CAACC,UAAU,GACxD,IAAAC,OAAA,CAAAJ,OAAA,EAAAF,QAAA,OAAI,CAACI,aAAa,CAACC,UAAU,EAAAE,IAAA,CAAAP,QAAA,EAASQ,YAAY,IAAK;MACrD,MAAM,CAACC,GAAG,CAAC,GAAG,IAAAC,KAAA,CAAAR,OAAA,EAAYM,YAAY,CAAC;MACvC,OAAOC,GAAG,KAAK,aAAa,IAAI,IAAAE,YAAG,EAAC,IAAI,CAACC,IAAI,EAAEH,GAAG,CAAC;IACrD,CAAC,CAAC,GACF,EAAE;IAEN,IAAI,CAACI,oBAAoB,GAAG,IAAIC,4BAAmB,CACjD,IAAI,CAACF,IAAI,EACTT,sBACF,CAAC;EACH;;EAEA;AACF;EACE,IAAIY,IAAIA,CAAA,EAAW;IACjB,OAAO,aAAa;EACtB;;EAEA;AACF;AACA;EACE,IAAIC,mBAAmBA,CAAA,EAAwB;IAC7C,OAAO,IAAI,CAACH,oBAAoB;EAClC;;EAEA;AACF;EACE,WAAWI,SAASA,CAAA,EAAW;IAC7B,OAAO,kBAAkB;EAC3B;AACF;AAACC,OAAA,CAAAhB,OAAA,GAAAN,gBAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"UserServicesModel.js","names":["_ResourceModel","_interopRequireDefault","require","_UserModel","UserServicesModel","ResourceModel","constructor","arguments","_defineProperty2","default","type","modelName","isApplicableModel","data","contributions","resourcetype","getInitialChildModelLinks","userData","userLink","setChildModels","models","user","_find","call","model","links","getLinkByKey","_user","UserModel","label","getContribution","changePassword","changePasswordLink","href","changeAvatar","changeAvatarLink","isLoggedIn","hasUser","UNSECURE_LINK_COUNT","length","_default","exports"],"sources":["../../../src/models/user/UserServicesModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport UserModel from \"../user/UserModel\";\n\nimport type { ModularUIModel } from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type Href from \"../href/Href\";\n\n/**\n * UserServicesModel model\n */\nclass UserServicesModel extends ResourceModel {\n _user: ?UserModel;\n\n /**\n */\n get type(): string {\n return \"UserServices\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"UserServicesModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"user_services\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const userData = this.userLink;\n return userData ? [userData] : [];\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n this.user = models.find((model) => model.type === \"User\");\n }\n\n /**\n */\n get userLink(): LinkModel | null {\n return this.links.getLinkByKey(\"Userdata\");\n }\n\n /**\n * return the user model for the current user\n */\n get user(): UserModel | null {\n return this._user || null;\n }\n\n /**\n * Set user data\n */\n set user(model: ?ModularUIModel) {\n this._user = model instanceof UserModel ? model : null;\n }\n\n /**\n * Getting the label of the application\n */\n get label(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n */\n get changePassword(): Href | null {\n const changePasswordLink = this.links.getLinkByKey(\"ChangePassword\");\n\n if (changePasswordLink) {\n return changePasswordLink.href;\n }\n\n return null;\n }\n\n /**\n */\n get changeAvatar(): Href | null {\n const changeAvatarLink = this.links.getLinkByKey(\"ChangeAvatar\");\n\n if (changeAvatarLink) {\n return changeAvatarLink.href;\n }\n\n return null;\n }\n\n // when more than three unsecure links are present (always present: self, contributions and api-docs),\n // the userservice is permitted and thus we have an indication the user is probably\n // logged in\n /**\n */\n get isLoggedIn(): boolean {\n const hasUser = this.user instanceof UserModel;\n\n const UNSECURE_LINK_COUNT = 3;\n return this.links.length > UNSECURE_LINK_COUNT || hasUser;\n }\n}\n\nexport default UserServicesModel;\n"],"mappings":";;;;;;;;;AACA,IAAAA,cAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AAOA;AACA;AACA;A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EA;AACF;EACE,IAAIC,cAAcA,CAAA,EAAgB;IAChC,MAAMC,kBAAkB,GAAG,IAAI,CAACP,KAAK,CAACC,YAAY,CAAC,gBAAgB,CAAC;IAEpE,IAAIM,kBAAkB,EAAE;MACtB,OAAOA,kBAAkB,CAACC,IAAI;IAChC;IAEA,OAAO,IAAI;EACb;;EAEA;AACF;EACE,IAAIC,YAAYA,CAAA,EAAgB;IAC9B,MAAMC,gBAAgB,GAAG,IAAI,CAACV,KAAK,CAACC,YAAY,CAAC,cAAc,CAAC;IAEhE,IAAIS,gBAAgB,EAAE;MACpB,OAAOA,gBAAgB,CAACF,IAAI;IAC9B;IAEA,OAAO,IAAI;EACb;;EAEA;EACA;EACA;EACA;AACF;EACE,IAAIG,UAAUA,CAAA,EAAY;IACxB,MAAMC,OAAO,GAAG,IAAI,CAAChB,IAAI,YAAYO,kBAAS;IAE9C,MAAMU,mBAAmB,GAAG,CAAC;IAC7B,OAAO,IAAI,CAACb,KAAK,CAACc,MAAM,GAAGD,mBAAmB,IAAID,OAAO;EAC3D;AACF;AAAC,IAAAG,QAAA,GAAAC,OAAA,CAAAhC,OAAA,GAEcL,iBAAiB"}
1
+ {"version":3,"file":"UserServicesModel.js","names":["_ResourceModel","_interopRequireDefault","require","_UserModel","UserServicesModel","ResourceModel","constructor","arguments","_defineProperty2","default","type","modelName","isApplicableModel","data","contributions","resourcetype","getInitialChildModelLinks","userData","userLink","setChildModels","models","user","_find","call","model","links","getLinkByKey","_user","UserModel","label","getContribution","changePassword","changePasswordLink","href","changeAvatar","changeAvatarLink","isLoggedIn","hasUser","UNSECURE_LINK_COUNT","length","_default","exports"],"sources":["../../../src/models/user/UserServicesModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport UserModel from \"../user/UserModel\";\n\nimport type { ModularUIModel } from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type Href from \"../href/Href\";\n\n/**\n * UserServicesModel model\n */\nclass UserServicesModel extends ResourceModel {\n _user: ?UserModel;\n\n /**\n */\n get type(): string {\n return \"UserServices\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"UserServicesModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"user_services\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const userData = this.userLink;\n return userData ? [userData] : [];\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n this.user = models.find((model) => model.type === \"User\");\n }\n\n /**\n */\n get userLink(): LinkModel | null {\n return this.links.getLinkByKey(\"Userdata\");\n }\n\n /**\n * return the user model for the current user\n */\n get user(): UserModel | null {\n return this._user || null;\n }\n\n /**\n * Set user data\n */\n set user(model: ?ModularUIModel) {\n this._user = model instanceof UserModel ? model : null;\n }\n\n /**\n * Getting the label of the application\n */\n get label(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n */\n get changePassword(): Href | null {\n const changePasswordLink = this.links.getLinkByKey(\"ChangePassword\");\n\n if (changePasswordLink) {\n return changePasswordLink.href;\n }\n\n return null;\n }\n\n /**\n */\n get changeAvatar(): Href | null {\n const changeAvatarLink = this.links.getLinkByKey(\"ChangeAvatar\");\n\n if (changeAvatarLink) {\n return changeAvatarLink.href;\n }\n\n return null;\n }\n\n // when more than three unsecure links are present (always present: self, contributions and api-docs),\n // the userservice is permitted and thus we have an indication the user is probably\n // logged in\n /**\n */\n get isLoggedIn(): boolean {\n const hasUser = this.user instanceof UserModel;\n\n const UNSECURE_LINK_COUNT = 3;\n return this.links.length > UNSECURE_LINK_COUNT || hasUser;\n }\n}\n\nexport default UserServicesModel;\n"],"mappings":";;;;;;;;;AACA,IAAAA,cAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AAOA;AACA;AACA;AACA,MAAME,iBAAiB,SAASC,s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A,CAAA,EAAgB;IAChC,MAAMC,kBAAkB,GAAG,IAAI,CAACP,KAAK,CAACC,YAAY,CAAC,gBAAgB,CAAC;IAEpE,IAAIM,kBAAkB,EAAE;MACtB,OAAOA,kBAAkB,CAACC,IAAI;IAChC;IAEA,OAAO,IAAI;EACb;;EAEA;AACF;EACE,IAAIC,YAAYA,CAAA,EAAgB;IAC9B,MAAMC,gBAAgB,GAAG,IAAI,CAACV,KAAK,CAACC,YAAY,CAAC,cAAc,CAAC;IAEhE,IAAIS,gBAAgB,EAAE;MACpB,OAAOA,gBAAgB,CAACF,IAAI;IAC9B;IAEA,OAAO,IAAI;EACb;;EAEA;EACA;EACA;EACA;AACF;EACE,IAAIG,UAAUA,CAAA,EAAY;IACxB,MAAMC,OAAO,GAAG,IAAI,CAAChB,IAAI,YAAYO,kBAAS;IAE9C,MAAMU,mBAAmB,GAAG,CAAC;IAC7B,OAAO,IAAI,CAACb,KAAK,CAACc,MAAM,GAAGD,mBAAmB,IAAID,OAAO;EAC3D;AACF;AAAC,IAAAG,QAAA,GAAAC,OAAA,CAAAhC,OAAA,GAEcL,iBAAiB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"Authenticate.js","names":["_Constants","require","_universalFetch","_interopRequireDefault","_Cache","_exceptions","_constants","Authenticate","constructor","_defineProperty2","default","_isBasic","authenticationType","type","loginType","INTERNAL_LOGIN_TYPE","JAAS","_includes","call","PAC4J_FORM","PAC4J_BASIC","Error","isBasicAuthentication","requestLogin","universalFetch","url","getBasePath","method","HTTP_METHODS","GET","headers","Accept","initLogin","_promise","resolve","catch","error","UnauthorizedException","login","username","password","doFormLogin","doBasicAuthentication","doJaasAuthentication","getFormLoginUrl","loginPath","getFormLoginData","encodedUsername","encodeURIComponent","encodedPassword","loginUsernameField","loginPasswordField","POST","data","Cache","addItem","btoa","then","getLogoutUrl","logoutPath","logout","response","clear","_default","exports"],"sources":["../../src/modularui/Authenticate.js"],"sourcesContent":["// @flow\nimport { HTTP_METHODS } from \"../constants/Constants\";\n\nimport universalFetch from \"../utils/fetch/universalFetch\";\nimport Cache from \"../utils/browser/Cache\";\n\nimport { UnauthorizedException } from \"../exceptions\";\nimport {\n INTERNAL_LOGIN_TYPE,\n loginType,\n loginPath,\n loginPasswordField,\n loginUsernameField,\n logoutPath,\n getBasePath,\n} from \"../constants\";\n\n/**\n */\nclass Authenticate {\n _isBasic: boolean;\n\n /**\n */\n constructor() {\n this._isBasic = false;\n }\n\n /**\n */\n get authenticationType(): $Keys<typeof INTERNAL_LOGIN_TYPE> {\n const type = loginType();\n\n if (!type || type === INTERNAL_LOGIN_TYPE.JAAS) {\n return INTERNAL_LOGIN_TYPE.JAAS;\n }\n\n if (type.includes(\"FormClient\")) {\n return INTERNAL_LOGIN_TYPE.PAC4J_FORM;\n } else if (type.includes(\"BasicClient\")) {\n return INTERNAL_LOGIN_TYPE.PAC4J_BASIC;\n }\n\n throw new Error(`Unsupported login type found: ${type}`);\n }\n\n /**\n */\n get isBasicAuthentication(): boolean {\n return (\n this._isBasic ||\n this.authenticationType === INTERNAL_LOGIN_TYPE.PAC4J_BASIC\n );\n }\n\n /**\n */\n set isBasicAuthentication(isBasicAuthentication: boolean) {\n this._isBasic = isBasicAuthentication;\n }\n\n /**\n */\n requestLogin(): Promise<any> {\n return universalFetch({\n url: `${getBasePath()}/login`,\n method: HTTP_METHODS.GET,\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n },\n });\n }\n\n /**\n */\n initLogin(initLogin: boolean): Promise<any> {\n if (this.isBasicAuthentication || !initLogin) {\n return Promise.resolve(true);\n }\n\n return this.requestLogin().catch((error) => {\n // when an unauthorizedexception is received on a request to the login service,\n // this indicates a basic authorization scenario\n // in case of form based authentication other exceptions are thrown\n if (error instanceof UnauthorizedException) {\n this.isBasicAuthentication = true;\n }\n\n return Promise.resolve({});\n });\n }\n\n /**\n */\n login(username: string, password: string): Promise<any> {\n switch (this.authenticationType) {\n case INTERNAL_LOGIN_TYPE.PAC4J_FORM:\n return this.doFormLogin(username, password);\n case INTERNAL_LOGIN_TYPE.PAC4J_BASIC:\n return this.doBasicAuthentication(username, password);\n default:\n return this.doJaasAuthentication(username, password);\n }\n }\n\n /**\n */\n getFormLoginUrl(): string {\n switch (this.authenticationType) {\n case INTERNAL_LOGIN_TYPE.PAC4J_BASIC:\n case INTERNAL_LOGIN_TYPE.PAC4J_FORM:\n return `${getBasePath()}${loginPath()}`;\n default:\n return `${getBasePath()}/j_security_check`;\n }\n }\n\n /**\n */\n getFormLoginData(username: string, password: string): string {\n const encodedUsername = encodeURIComponent(username);\n const encodedPassword = encodeURIComponent(password);\n\n switch (this.authenticationType) {\n case INTERNAL_LOGIN_TYPE.PAC4J_BASIC:\n case INTERNAL_LOGIN_TYPE.PAC4J_FORM:\n return `${loginUsernameField()}=${encodedUsername}&${loginPasswordField()}=${encodedPassword}`;\n default:\n return `j_username=${encodedUsername}&j_password=${encodedPassword}`;\n }\n }\n\n /**\n */\n doFormLogin(username: string, password: string): Promise<any> {\n return universalFetch({\n url: this.getFormLoginUrl(),\n method: HTTP_METHODS.POST,\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n },\n data: this.getFormLoginData(username, password),\n });\n }\n\n /**\n */\n doBasicAuthentication(username: string, password: string): Promise<any> {\n Cache.addItem(\"basic\", btoa(`${username}:${password}`));\n return this.requestLogin();\n }\n\n /**\n */\n doJaasAuthentication(username: string, password: string): Promise<any> {\n return this.initLogin(true).then(() => {\n if (this.isBasicAuthentication) {\n return this.doBasicAuthentication(username, password);\n }\n return this.doFormLogin(username, password);\n });\n }\n\n /**\n */\n getLogoutUrl(): string {\n switch (this.authenticationType) {\n case INTERNAL_LOGIN_TYPE.PAC4J_BASIC:\n case INTERNAL_LOGIN_TYPE.PAC4J_FORM:\n return `${getBasePath()}${logoutPath()}`;\n default:\n return `${getBasePath()}/Logoff`;\n }\n }\n\n /**\n */\n logout(): Promise<any> {\n return universalFetch({\n url: this.getLogoutUrl(),\n }).then((response) => {\n // clear cache because of cached contributions\n Cache.clear();\n return response;\n });\n }\n}\n\nexport default Authenticate;\n"],"mappings":";;;;;;;;;;AACA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAAC,eAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,MAAA,GAAAD,sBAAA,CAAAF,OAAA;AAEA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AAUA;AACA;AACA,MAAMM,YAAY,CAAC;EAGjB;AACF;EACEC,WAAWA,CAAA,EAAG;IAAA,IAAAC,gBAAA,CAAAC,OAAA;IACZ,IAAI,CAACC,QAAQ,GAAG,KAAK;EACvB;;EAEA;AACF;EACE,IAAIC,kBAAkBA,CAAA,EAAsC;IAC1D,MAAMC,IAAI,GAAG,IAAAC,oBAAS,EAAC,CAAC;IAExB,IAAI,CAACD,IAAI,IAAIA,IAAI,KAAKE,8BAAmB,CAACC,IAAI,EAAE;MAC9C,OAAOD,8BAAmB,CAACC,IAAI;IACjC;IAEA,IAAI,IAAAC,SAAA,CAAAP,OAAA,EAAAG,IAAI,EAAAK,IAAA,CAAJL,IAAI,EAAU,YAAY,CAAC,EAAE;MAC/B,OAAOE,8BAAmB,CAACI,UAAU;IACvC,CAAC,MAAM,IAAI,IAAAF,SAAA,CAAAP,OAAA,EAAAG,IAAI,EAAAK,IAAA,CAAJL,IAAI,EAAU,aAAa,CAAC,EAAE;MACvC,OAAOE,8BAAmB,CAACK,WAAW;IACxC;IAEA,MAAM,IAAIC,KAAK,CAAE,iCAAgCR,IAAK,EAAC,CAAC;EAC1D;;EAEA;AACF;EACE,IAAIS,qBAAqBA,CAAA,EAAY;IACnC,OACE,IAAI,CAACX,QAAQ,IACb,IAAI,CAACC,kBAAkB,KAAKG,8BAAmB,CAACK,WAAW;EAE/D;;EAEA;AACF;EACE,IAAIE,qBAAqBA,CAACA,qBAA8B,EAAE;IACxD,IAAI,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AEA;AACF;EACEoB,oBAAoBA,CAACJ,QAAgB,EAAEC,QAAgB,EAAgB;IACrE,OAAO,IAAI,CAACR,SAAS,CAAC,IAAI,CAAC,CAACyB,IAAI,CAAC,MAAM;MACrC,IAAI,IAAI,CAACnC,qBAAqB,EAAE;QAC9B,OAAO,IAAI,CAACoB,qBAAqB,CAACH,QAAQ,EAAEC,QAAQ,CAAC;MACvD;MACA,OAAO,IAAI,CAACC,WAAW,CAACF,QAAQ,EAAEC,QAAQ,CAAC;IAC7C,CAAC,CAAC;EACJ;;EAEA;AACF;EACEkB,YAAYA,CAAA,EAAW;IACrB,QAAQ,IAAI,CAAC9C,kBAAkB;MAC7B,KAAKG,8BAAmB,CAACK,WAAW;MACpC,KAAKL,8BAAmB,CAACI,UAAU;QACjC,OAAQ,GAAE,IAAAO,sBAAW,EAAC,CAAE,GAAE,IAAAiC,qBAAU,EAAC,CAAE,EAAC;MAC1C;QACE,OAAQ,GAAE,IAAAjC,sBAAW,EAAC,CAAE,SAAQ;IACpC;EACF;;EAEA;AACF;EACEkC,MAAMA,CAAA,EAAiB;IACrB,OAAO,IAAApC,uBAAc,EAAC;MACpBC,GAAG,EAAE,IAAI,CAACiC,YAAY,CAAC;IACzB,CAAC,CAAC,CAACD,IAAI,CAAEI,QAAQ,IAAK;MACpB;MACAP,cAAK,CAACQ,KAAK,CAAC,CAAC;MACb,OAAOD,QAAQ;IACjB,CAAC,CAAC;EACJ;AACF;AAAC,IAAAE,QAAA,GAAAC,OAAA,CAAAtD,OAAA,GAEcH,YAAY"}
1
+ {"version":3,"file":"Authenticate.js","names":["_Constants","require","_universalFetch","_interopRequireDefault","_Cache","_exceptions","_constants","Authenticate","constructor","_defineProperty2","default","_isBasic","authenticationType","type","loginType","INTERNAL_LOGIN_TYPE","JAAS","_includes","call","PAC4J_FORM","PAC4J_BASIC","Error","isBasicAuthentication","requestLogin","universalFetch","url","getBasePath","method","HTTP_METHODS","GET","headers","Accept","initLogin","_promise","resolve","catch","error","UnauthorizedException","login","username","password","doFormLogin","doBasicAuthentication","doJaasAuthentication","getFormLoginUrl","loginPath","getFormLoginData","encodedUsername","encodeURIComponent","encodedPassword","loginUsernameField","loginPasswordField","POST","data","Cache","addItem","btoa","then","getLogoutUrl","logoutPath","logout","response","clear","_default","exports"],"sources":["../../src/modularui/Authenticate.js"],"sourcesContent":["// @flow\nimport { HTTP_METHODS } from \"../constants/Constants\";\n\nimport universalFetch from \"../utils/fetch/universalFetch\";\nimport Cache from \"../utils/browser/Cache\";\n\nimport { UnauthorizedException } from \"../exceptions\";\nimport {\n INTERNAL_LOGIN_TYPE,\n loginType,\n loginPath,\n loginPasswordField,\n loginUsernameField,\n logoutPath,\n getBasePath,\n} from \"../constants\";\n\n/**\n */\nclass Authenticate {\n _isBasic: boolean;\n\n /**\n */\n constructor() {\n this._isBasic = false;\n }\n\n /**\n */\n get authenticationType(): $Keys<typeof INTERNAL_LOGIN_TYPE> {\n const type = loginType();\n\n if (!type || type === INTERNAL_LOGIN_TYPE.JAAS) {\n return INTERNAL_LOGIN_TYPE.JAAS;\n }\n\n if (type.includes(\"FormClient\")) {\n return INTERNAL_LOGIN_TYPE.PAC4J_FORM;\n } else if (type.includes(\"BasicClient\")) {\n return INTERNAL_LOGIN_TYPE.PAC4J_BASIC;\n }\n\n throw new Error(`Unsupported login type found: ${type}`);\n }\n\n /**\n */\n get isBasicAuthentication(): boolean {\n return (\n this._isBasic ||\n this.authenticationType === INTERNAL_LOGIN_TYPE.PAC4J_BASIC\n );\n }\n\n /**\n */\n set isBasicAuthentication(isBasicAuthentication: boolean) {\n this._isBasic = isBasicAuthentication;\n }\n\n /**\n */\n requestLogin(): Promise<any> {\n return universalFetch({\n url: `${getBasePath()}/login`,\n method: HTTP_METHODS.GET,\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n },\n });\n }\n\n /**\n */\n initLogin(initLogin: boolean): Promise<any> {\n if (this.isBasicAuthentication || !initLogin) {\n return Promise.resolve(true);\n }\n\n return this.requestLogin().catch((error) => {\n // when an unauthorizedexception is received on a request to the login service,\n // this indicates a basic authorization scenario\n // in case of form based authentication other exceptions are thrown\n if (error instanceof UnauthorizedException) {\n this.isBasicAuthentication = true;\n }\n\n return Promise.resolve({});\n });\n }\n\n /**\n */\n login(username: string, password: string): Promise<any> {\n switch (this.authenticationType) {\n case INTERNAL_LOGIN_TYPE.PAC4J_FORM:\n return this.doFormLogin(username, password);\n case INTERNAL_LOGIN_TYPE.PAC4J_BASIC:\n return this.doBasicAuthentication(username, password);\n default:\n return this.doJaasAuthentication(username, password);\n }\n }\n\n /**\n */\n getFormLoginUrl(): string {\n switch (this.authenticationType) {\n case INTERNAL_LOGIN_TYPE.PAC4J_BASIC:\n case INTERNAL_LOGIN_TYPE.PAC4J_FORM:\n return `${getBasePath()}${loginPath()}`;\n default:\n return `${getBasePath()}/j_security_check`;\n }\n }\n\n /**\n */\n getFormLoginData(username: string, password: string): string {\n const encodedUsername = encodeURIComponent(username);\n const encodedPassword = encodeURIComponent(password);\n\n switch (this.authenticationType) {\n case INTERNAL_LOGIN_TYPE.PAC4J_BASIC:\n case INTERNAL_LOGIN_TYPE.PAC4J_FORM:\n return `${loginUsernameField()}=${encodedUsername}&${loginPasswordField()}=${encodedPassword}`;\n default:\n return `j_username=${encodedUsername}&j_password=${encodedPassword}`;\n }\n }\n\n /**\n */\n doFormLogin(username: string, password: string): Promise<any> {\n return universalFetch({\n url: this.getFormLoginUrl(),\n method: HTTP_METHODS.POST,\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n },\n data: this.getFormLoginData(username, password),\n });\n }\n\n /**\n */\n doBasicAuthentication(username: string, password: string): Promise<any> {\n Cache.addItem(\"basic\", btoa(`${username}:${password}`));\n return this.requestLogin();\n }\n\n /**\n */\n doJaasAuthentication(username: string, password: string): Promise<any> {\n return this.initLogin(true).then(() => {\n if (this.isBasicAuthentication) {\n return this.doBasicAuthentication(username, password);\n }\n return this.doFormLogin(username, password);\n });\n }\n\n /**\n */\n getLogoutUrl(): string {\n switch (this.authenticationType) {\n case INTERNAL_LOGIN_TYPE.PAC4J_BASIC:\n case INTERNAL_LOGIN_TYPE.PAC4J_FORM:\n return `${getBasePath()}${logoutPath()}`;\n default:\n return `${getBasePath()}/Logoff`;\n }\n }\n\n /**\n */\n logout(): Promise<any> {\n return universalFetch({\n url: this.getLogoutUrl(),\n }).then((response) => {\n // clear cache because of cached contributions\n Cache.clear();\n return response;\n });\n }\n}\n\nexport default Authenticate;\n"],"mappings":";;;;;;;;;;AACA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAAC,eAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,MAAA,GAAAD,sBAAA,CAAAF,OAAA;AAEA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AAUA;AACA;AACA,MAAMM,YAAY,CAAC;EAGjB;AACF;EACEC,WAAWA,CAAA,EAAG;IAAA,IAAAC,gBAAA,CAAAC,OAAA;IACZ,IAAI,CAACC,QAAQ,GAAG,KAAK;EACvB;;EAEA;AACF;EACE,IAAIC,kBAAkBA,CAAA,EAAsC;IAC1D,MAAMC,IAAI,GAAG,IAAAC,oBAAS,EAAC,CAAC;IAExB,IAAI,CAACD,IAAI,IAAIA,IAAI,KAAKE,8BAAmB,CAACC,IAAI,EAAE;MAC9C,OAAOD,8BAAmB,CAACC,IAAI;IACjC;IAEA,IAAI,IAAAC,SAAA,CAAAP,OAAA,EAAAG,IAAI,EAAAK,IAAA,CAAJL,IAAI,EAAU,YAAY,CAAC,EAAE;MAC/B,OAAOE,8BAAmB,CAACI,UAAU;IACvC,CAAC,MAAM,IAAI,IAAAF,SAAA,CAAAP,OAAA,EAAAG,IAAI,EAAAK,IAAA,CAAJL,IAAI,EAAU,aAAa,CAAC,EAAE;MACvC,OAAOE,8BAAmB,CAACK,WAAW;IACxC;IAEA,MAAM,IAAIC,KAAK,CAAE,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file":"CaptchaRequest.js","names":["_xhr","_interopRequireDefault","require","_constants","CaptchaRequest","constructor","_defineProperty2","default","captchaResponse","response","_tokenId","tokenId","_image","image","valid","error","init","xhr","url","getCaptchaPath","then","send","answer","method","HTTP_METHODS","POST","data","catch","refresh","_default","exports"],"sources":["../../src/modularui/CaptchaRequest.js"],"sourcesContent":["// @flow\nimport xhr from \"../utils/fetch/xhr\";\nimport { getCaptchaPath, HTTP_METHODS } from \"../constants\";\n\ntype CaptchaInitialResponse = {\n tokenId: string,\n image: string,\n};\n\ntype CaptchaValidResponse = {\n valid: boolean,\n};\n\ntype CaptchaInvalidResponse = {\n tokenId: string,\n image: string,\n valid: boolean,\n error: { id: string },\n};\n\ntype CaptchaResponse = {\n tokenId: string,\n image: string,\n valid: boolean,\n error: { id: string } | null,\n};\n\n/**\n */\nclass CaptchaRequest {\n _tokenId: string;\n _image: string;\n\n /**\n */\n captchaResponse(\n response:\n | CaptchaInitialResponse\n | CaptchaValidResponse\n | CaptchaInvalidResponse,\n ): CaptchaResponse {\n this._tokenId = response.tokenId ?? this._tokenId;\n this._image = response.image ?? this._image;\n\n return {\n tokenId: this._tokenId,\n image: this._image,\n valid: response.valid ?? false,\n error: response.error ?? null,\n };\n }\n\n /**\n * Initiate the captcha request\n */\n init(): Promise<CaptchaResponse> {\n return xhr({\n url: getCaptchaPath(),\n }).then((response) => this.captchaResponse(response));\n }\n\n /**\n * Answer the captcha\n */\n send(answer?: string): Promise<CaptchaResponse> {\n return xhr({\n url: getCaptchaPath(),\n method: HTTP_METHODS.POST,\n data: {\n tokenId: this._tokenId ?? \"\",\n answer: answer ?? \"\",\n },\n })\n .then((response) => this.captchaResponse(response))\n .catch((error) => this.captchaResponse(error.response));\n }\n\n /**\n * Reset the captcha and receive a new token and image\n */\n refresh(): Promise<CaptchaResponse> {\n return this.init();\n }\n}\n\nexport default CaptchaRequest;\n"],"mappings":";;;;;;;;AACA,IAAAA,IAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA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;AACF;AACA;EACEmB,OAAOA,CAAA,EAA6B;IAClC,OAAO,IAAI,CAACZ,IAAI,CAAC,CAAC;EACpB;AACF;AAAC,IAAAa,QAAA,GAAAC,OAAA,CAAAvB,OAAA,GAEcH,cAAc"}
1
+ {"version":3,"file":"CaptchaRequest.js","names":["_xhr","_interopRequireDefault","require","_constants","CaptchaRequest","constructor","_defineProperty2","default","captchaResponse","response","_tokenId","tokenId","_image","image","valid","error","init","xhr","url","getCaptchaPath","then","send","answer","method","HTTP_METHODS","POST","data","catch","refresh","_default","exports"],"sources":["../../src/modularui/CaptchaRequest.js"],"sourcesContent":["// @flow\nimport xhr from \"../utils/fetch/xhr\";\nimport { getCaptchaPath, HTTP_METHODS } from \"../constants\";\n\ntype CaptchaInitialResponse = {\n tokenId: string,\n image: string,\n};\n\ntype CaptchaValidResponse = {\n valid: boolean,\n};\n\ntype CaptchaInvalidResponse = {\n tokenId: string,\n image: string,\n valid: boolean,\n error: { id: string },\n};\n\ntype CaptchaResponse = {\n tokenId: string,\n image: string,\n valid: boolean,\n error: { id: string } | null,\n};\n\n/**\n */\nclass CaptchaRequest {\n _tokenId: string;\n _image: string;\n\n /**\n */\n captchaResponse(\n response:\n | CaptchaInitialResponse\n | CaptchaValidResponse\n | CaptchaInvalidResponse,\n ): CaptchaResponse {\n this._tokenId = response.tokenId ?? this._tokenId;\n this._image = response.image ?? this._image;\n\n return {\n tokenId: this._tokenId,\n image: this._image,\n valid: response.valid ?? false,\n error: response.error ?? null,\n };\n }\n\n /**\n * Initiate the captcha request\n */\n init(): Promise<CaptchaResponse> {\n return xhr({\n url: getCaptchaPath(),\n }).then((response) => this.captchaResponse(response));\n }\n\n /**\n * Answer the captcha\n */\n send(answer?: string): Promise<CaptchaResponse> {\n return xhr({\n url: getCaptchaPath(),\n method: HTTP_METHODS.POST,\n data: {\n tokenId: this._tokenId ?? \"\",\n answer: answer ?? \"\",\n },\n })\n .then((response) => this.captchaResponse(response))\n .catch((error) => this.captchaResponse(error.response));\n }\n\n /**\n * Reset the captcha and receive a new token and image\n */\n refresh(): Promise<CaptchaResponse> {\n return this.init();\n }\n}\n\nexport default CaptchaRequest;\n"],"mappings":";;;;;;;;AACA,IAAAA,IAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAyBA;AACA;AACA,MAAME,cAAc,CAAC;EAAAC,YAAA;IAAA,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;EAAA;EAInB;AACF;EACEC,eAAeA,CACbC,QAG0B,EACT;IACjB,IAAI,CAACC,QAAQ,GAAGD,QAAQ,CAACE,OAAO,IAAI,IAAI,CAACD,QAAQ;IACjD,IAAI,CAACE,MAAM,GAAGH,QAAQ,CAACI,KAAK,IAAI,IAAI,CAACD,MAAM;IAE3C,OAAO;MACLD,OAAO,EAAE,IAAI,CAACD,QAAQ;MACtBG,KAAK,EAAE,IAAI,CAACD,MAAM;MAClBE,KAAK,EAAEL,QAAQ,CAACK,KAAK,IAAI,KAAK;MAC9BC,KAAK,EAAEN,QAAQ,CAACM,KAAK,IAAI;IAC3B,CAAC;EACH;;EAEA;AACF;AACA;EACEC,IAAIA,CAAA,EAA6B;IAC/B,OAAO,IAAAC,YAAG,EAAC;MACTC,GAAG,EAAE,IAAAC,yBAAc,EAAC;IACtB,CAAC,CAAC,CAACC,IAAI,CAAEX,QAAQ,IAAK,IAAI,CAACD,eAAe,CAACC,QAAQ,CAAC,CAAC;EACvD;;EAEA;AACF;AACA;EACEY,IAAIA,CAACC,MAAe,EAA4B;IAC9C,OAAO,IAAAL,YAAG,EAAC;MACTC,GAAG,EAAE,IAAAC,yBAAc,EAAC,CAAC;MACrBI,MAAM,EAAEC,uBAAY,CAACC,IAAI;MACzBC,IAAI,EAAE;QACJf,OAAO,EAAE,IAAI,CAACD,QAAQ,IAAI,EAAE;QAC5BY,MAAM,EAAEA,MAAM,IAAI;MACpB;IACF,CAAC,CAAC,CACCF,IAAI,CAAEX,QAAQ,IAAK,IAAI,CAACD,eAAe,CAACC,QAAQ,CAAC,CAAC,CAClDkB,KAAK,CAAEZ,KAAK,IAAK,IAAI,CAACP,eAAe,CAACO,KAAK,CAACN,QAAQ,CAAC,CAAC;EAC3D;;EAEA;AACF;AACA;EACEmB,OAAOA,CAAA,EAA6B;IAClC,OAAO,IAAI,CAACZ,IAAI,CAAC,CAAC;EACpB;AACF;AAAC,IAAAa,QAAA,GAAAC,OAAA,CAAAvB,OAAA,GAEcH,cAAc","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"ModularUIError.js","names":["ModularUIError","Error","constructor","message","response","resource","_defineProperty2","default","captureStackTrace","_default","exports"],"sources":["../../src/modularui/ModularUIError.js"],"sourcesContent":["// @flow\n/**\n */\nclass ModularUIError extends Error {\n response: Object;\n resource: string;\n\n /**\n */\n constructor(message: string, response: Object, resource: string) {\n super(message);\n\n this.response = response;\n this.resource = resource;\n\n // Without passing ModularUIError to captureStackTrace, the ModularUIError\n // frame would show up in the .stack property. By passing\n // the constructor, we omit that frame, and retain all frames below it.\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, ModularUIError);\n }\n }\n}\n\nexport default ModularUIError;\n"],"mappings":";;;;;;;;AACA;AACA;AACA,MAAMA,cAAc,SAASC,KAAK,CAAC;EAIjC;AACF;EACEC,WAAWA,CAACC,OAAe,EAAEC,QAAgB,EAAEC,QAAgB,EAAE;IAC/D,KAAK,CAACF,OAAO,CAAC;IAAC,IAAAG,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAEf,IAAI,CAACH,QAAQ,GAAGA,QAAQ;IACxB,IAAI,CAACC,QAAQ,GAAGA,QAAQ;;IAExB;IACA;IACA;IACA,IAAIJ,KAAK,CAACO,iBAAiB,EAAE;MAC3BP,KAAK,CAACO,iBAAiB,CAAC,IAAI,EAAER,cAAc,CAAC;IAC/C;EACF;AACF;AAAC,IAAAS,QAAA,GAAAC,OAAA,CAAAH,OAAA,GAEcP,cAAc"}
1
+ {"version":3,"file":"ModularUIError.js","names":["ModularUIError","Error","constructor","message","response","resource","_defineProperty2","default","captureStackTrace","_default","exports"],"sources":["../../src/modularui/ModularUIError.js"],"sourcesContent":["// @flow\n/**\n */\nclass ModularUIError extends Error {\n response: Object;\n resource: string;\n\n /**\n */\n constructor(message: string, response: Object, resource: string) {\n super(message);\n\n this.response = response;\n this.resource = resource;\n\n // Without passing ModularUIError to captureStackTrace, the ModularUIError\n // frame would show up in the .stack property. By passing\n // the constructor, we omit that frame, and retain all frames below it.\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, ModularUIError);\n }\n }\n}\n\nexport default ModularUIError;\n"],"mappings":";;;;;;;;AACA;AACA;AACA,MAAMA,cAAc,SAASC,KAAK,CAAC;EAIjC;AACF;EACEC,WAAWA,CAACC,OAAe,EAAEC,QAAgB,EAAEC,QAAgB,EAAE;IAC/D,KAAK,CAACF,OAAO,CAAC;IAAC,IAAAG,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAEf,IAAI,CAACH,QAAQ,GAAGA,QAAQ;IACxB,IAAI,CAACC,QAAQ,GAAGA,QAAQ;;IAExB;IACA;IACA;IACA,IAAIJ,KAAK,CAACO,iBAAiB,EAAE;MAC3BP,KAAK,CAACO,iBAAiB,CAAC,IAAI,EAAER,cAAc,CAAC;IAC/C;EACF;AACF;AAAC,IAAAS,QAAA,GAAAC,OAAA,CAAAH,OAAA,GAEcP,cAAc","ignoreList":[]}