@beinformed/ui 1.25.0 → 1.25.1-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (534) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/esm/builder/mergeLayoutHintConfigurations.js.map +1 -1
  3. package/esm/constants/Settings.js.map +1 -1
  4. package/esm/hooks/useAuthentication.js +1 -1
  5. package/esm/hooks/useAuthentication.js.map +1 -1
  6. package/esm/hooks/useModelCatalog.js +0 -1
  7. package/esm/hooks/useModelCatalog.js.map +1 -1
  8. package/esm/hooks/useModels.js +1 -1
  9. package/esm/hooks/useModels.js.map +1 -1
  10. package/esm/hooks/useModularUI.js +1 -1
  11. package/esm/hooks/useModularUI.js.map +1 -1
  12. package/esm/hooks/useModularUIBasic.js +4 -1
  13. package/esm/hooks/useModularUIBasic.js.map +1 -1
  14. package/esm/hooks/useRouter.js +1 -1
  15. package/esm/hooks/useRouter.js.map +1 -1
  16. package/esm/models/attributes/AttributeCollection.js.map +1 -1
  17. package/esm/models/attributes/AttributeModel.js.map +1 -1
  18. package/esm/models/attributes/CompositeAttributeChildCollection.js.map +1 -1
  19. package/esm/models/attributes/NumberAttributeModel.js +5 -2
  20. package/esm/models/attributes/NumberAttributeModel.js.map +1 -1
  21. package/esm/models/attributes/_createAttribute.js.map +1 -1
  22. package/esm/models/attributes/layouthint-rules/BaseLayoutHintRule.js.map +1 -1
  23. package/esm/models/attributes/layouthint-rules/DependentAttribute.js.map +1 -1
  24. package/esm/models/base/ResourceModel.js.map +1 -1
  25. package/esm/models/content/ContentTOCModel.js.map +1 -1
  26. package/esm/models/filters/FilterCollection.js.map +1 -1
  27. package/esm/models/form/FormModel.js.map +1 -1
  28. package/esm/models/links/LinkModel.js +3 -1
  29. package/esm/models/links/LinkModel.js.map +1 -1
  30. package/esm/models/links/normalizeLinkJSON.js.map +1 -1
  31. package/esm/models/list/ListModel.js.map +1 -1
  32. package/esm/models/parameter/Parameter.js +1 -1
  33. package/esm/models/parameter/Parameter.js.map +1 -1
  34. package/esm/models/types.js.map +1 -1
  35. package/esm/modularui/ModularUIRequest.js.map +1 -1
  36. package/esm/react-client/client.js +1 -1
  37. package/esm/react-client/client.js.map +1 -1
  38. package/esm/react-client/rehydrate.js.map +1 -1
  39. package/esm/react-server/createSSRComplete.js.map +1 -1
  40. package/esm/react-server/renderSSRComplete.js +4 -2
  41. package/esm/react-server/renderSSRComplete.js.map +1 -1
  42. package/esm/react-server/serverUtil.js +18 -9
  43. package/esm/react-server/serverUtil.js.map +1 -1
  44. package/esm/react-theme/ThemeProvider.js +1 -1
  45. package/esm/react-theme/ThemeProvider.js.map +1 -1
  46. package/esm/react-theme/createTheme.js +8 -3
  47. package/esm/react-theme/createTheme.js.map +1 -1
  48. package/esm/react-theme/utils/contrast.js +3 -1
  49. package/esm/react-theme/utils/contrast.js.map +1 -1
  50. package/esm/react-theme/utils/corners.js +3 -1
  51. package/esm/react-theme/utils/corners.js.map +1 -1
  52. package/esm/react-theme/utils/spacers.js +9 -3
  53. package/esm/react-theme/utils/spacers.js.map +1 -1
  54. package/esm/redux/_i18n/{actions.js → I18nActions.js} +1 -1
  55. package/esm/redux/_i18n/I18nActions.js.map +1 -0
  56. package/esm/redux/_i18n/{reducer.js → I18nReducer.js} +1 -1
  57. package/esm/redux/_i18n/I18nReducer.js.map +1 -0
  58. package/esm/redux/_i18n/index.js +2 -2
  59. package/esm/redux/_i18n/index.js.map +1 -1
  60. package/esm/redux/_modularui/{actions.js → ModularUIActions.js} +1 -1
  61. package/esm/redux/_modularui/ModularUIActions.js.map +1 -0
  62. package/esm/redux/_modularui/{connector.js → ModularUIConnector.js} +5 -5
  63. package/esm/redux/_modularui/ModularUIConnector.js.map +1 -0
  64. package/esm/redux/_modularui/{middleware.js → ModularUIMiddleware.js} +2 -2
  65. package/esm/redux/_modularui/ModularUIMiddleware.js.map +1 -0
  66. package/esm/redux/_modularui/{reducer.js → ModularUIReducer.js} +4 -6
  67. package/esm/redux/_modularui/ModularUIReducer.js.map +1 -0
  68. package/esm/redux/_modularui/{selectors.js → ModularUISelectors.js} +1 -1
  69. package/esm/redux/_modularui/ModularUISelectors.js.map +1 -0
  70. package/esm/redux/_modularui/{modularuiUtils.js → ModularUIUtils.js} +1 -1
  71. package/esm/redux/_modularui/{modularuiUtils.js.map → ModularUIUtils.js.map} +1 -1
  72. package/esm/redux/_modularui/index.js +6 -6
  73. package/esm/redux/_modularui/index.js.map +1 -1
  74. package/esm/redux/_modularui/types.js.map +1 -1
  75. package/esm/redux/_modularui/withModularUI.js +1 -1
  76. package/esm/redux/_modularui/withModularUI.js.map +1 -1
  77. package/esm/redux/_router/{actions.js → RouterActions.js} +1 -1
  78. package/esm/redux/_router/RouterActions.js.map +1 -0
  79. package/esm/redux/_router/{connectors.js → RouterConnectors.js} +2 -2
  80. package/esm/redux/_router/RouterConnectors.js.map +1 -0
  81. package/esm/redux/_router/{middleware.js → RouterMiddleware.js} +1 -1
  82. package/esm/redux/_router/RouterMiddleware.js.map +1 -0
  83. package/esm/redux/_router/{reducer.js → RouterReducer.js} +1 -1
  84. package/esm/redux/_router/RouterReducer.js.map +1 -0
  85. package/esm/redux/_router/index.js +4 -4
  86. package/esm/redux/_router/index.js.map +1 -1
  87. package/esm/redux/actions/Application.js +2 -2
  88. package/esm/redux/actions/Application.js.map +1 -1
  89. package/esm/redux/actions/Authorization.js +3 -3
  90. package/esm/redux/actions/Authorization.js.map +1 -1
  91. package/esm/redux/actions/Error.js +1 -1
  92. package/esm/redux/actions/Error.js.map +1 -1
  93. package/esm/redux/actions/Form.js +2 -2
  94. package/esm/redux/actions/Form.js.map +1 -1
  95. package/esm/redux/actions/FormAttributeSet.js +1 -1
  96. package/esm/redux/actions/FormAttributeSet.js.map +1 -1
  97. package/esm/redux/actions/FormAttributeSetRepeatable.js +1 -1
  98. package/esm/redux/actions/FormAttributeSetRepeatable.js.map +1 -1
  99. package/esm/redux/actions/FormAutosave.js +1 -1
  100. package/esm/redux/actions/FormAutosave.js.map +1 -1
  101. package/esm/redux/actions/FormAutosubmit.js +1 -1
  102. package/esm/redux/actions/FormAutosubmit.js.map +1 -1
  103. package/esm/redux/actions/FormValidations.js +1 -1
  104. package/esm/redux/actions/FormValidations.js.map +1 -1
  105. package/esm/redux/actions/Notification.js.map +1 -1
  106. package/esm/redux/actions/Preferences.js +1 -1
  107. package/esm/redux/actions/Preferences.js.map +1 -1
  108. package/esm/redux/actions/SignIn.js +1 -1
  109. package/esm/redux/actions/SignIn.js.map +1 -1
  110. package/esm/redux/actions/SignOut.js +1 -1
  111. package/esm/redux/actions/SignOut.js.map +1 -1
  112. package/esm/redux/connectors/Application.js +1 -1
  113. package/esm/redux/connectors/Application.js.map +1 -1
  114. package/esm/redux/connectors/Breadcrumb.js +1 -1
  115. package/esm/redux/connectors/Breadcrumb.js.map +1 -1
  116. package/esm/redux/connectors/CaseView.js +1 -1
  117. package/esm/redux/connectors/CaseView.js.map +1 -1
  118. package/esm/redux/connectors/ConceptDetail.js +1 -1
  119. package/esm/redux/connectors/ConceptDetail.js.map +1 -1
  120. package/esm/redux/connectors/ContentBrowser.js +1 -1
  121. package/esm/redux/connectors/ContentBrowser.js.map +1 -1
  122. package/esm/redux/connectors/ContentDetail.js +1 -1
  123. package/esm/redux/connectors/ContentDetail.js.map +1 -1
  124. package/esm/redux/connectors/ContentDetailSection.js +1 -1
  125. package/esm/redux/connectors/ContentDetailSection.js.map +1 -1
  126. package/esm/redux/connectors/Form.js +1 -1
  127. package/esm/redux/connectors/Form.js.map +1 -1
  128. package/esm/redux/connectors/ListDetail.js +1 -1
  129. package/esm/redux/connectors/ListDetail.js.map +1 -1
  130. package/esm/redux/connectors/ModelCatalog.js +1 -1
  131. package/esm/redux/connectors/ModelCatalog.js.map +1 -1
  132. package/esm/redux/connectors/PanelRenderer.js +1 -1
  133. package/esm/redux/connectors/PanelRenderer.js.map +1 -1
  134. package/esm/redux/connectors/Preferences.js.map +1 -1
  135. package/esm/redux/connectors/QuickSearch.js +2 -2
  136. package/esm/redux/connectors/QuickSearch.js.map +1 -1
  137. package/esm/redux/connectors/SignIn.js +1 -1
  138. package/esm/redux/connectors/SignIn.js.map +1 -1
  139. package/esm/redux/connectors/SignOut.js.map +1 -1
  140. package/esm/redux/connectors/Tab.js +1 -1
  141. package/esm/redux/connectors/Tab.js.map +1 -1
  142. package/esm/redux/reducers/ModalsReducer.js.map +1 -1
  143. package/esm/redux/reducers/ProgressIndicatorReducer.js.map +1 -1
  144. package/esm/redux/reducers/createReducer.js +3 -3
  145. package/esm/redux/reducers/createReducer.js.map +1 -1
  146. package/esm/redux/store/configureStore.js +4 -4
  147. package/esm/redux/store/configureStore.js.map +1 -1
  148. package/esm/utils/fetch/universalFetch.js +3 -2
  149. package/esm/utils/fetch/universalFetch.js.map +1 -1
  150. package/esm/utils/fetch/xhr.js.map +1 -1
  151. package/esm/utils/helpers/objects.js +4 -3
  152. package/esm/utils/helpers/objects.js.map +1 -1
  153. package/esm/utils/helpers/sanitizeHtml.js.map +1 -1
  154. package/esm/utils/number/parseNumbers.js.map +1 -1
  155. package/lib/builder/mergeLayoutHintConfigurations.js.flow +1 -1
  156. package/lib/builder/mergeLayoutHintConfigurations.js.map +1 -1
  157. package/lib/constants/Settings.js.flow +1 -1
  158. package/lib/constants/Settings.js.map +1 -1
  159. package/lib/hooks/useAuthentication.js +3 -3
  160. package/lib/hooks/useAuthentication.js.flow +1 -1
  161. package/lib/hooks/useAuthentication.js.map +1 -1
  162. package/lib/hooks/useModelCatalog.js.flow +2 -1
  163. package/lib/hooks/useModelCatalog.js.map +1 -1
  164. package/lib/hooks/useModels.js +2 -2
  165. package/lib/hooks/useModels.js.flow +1 -1
  166. package/lib/hooks/useModels.js.map +1 -1
  167. package/lib/hooks/useModularUI.js +3 -3
  168. package/lib/hooks/useModularUI.js.flow +4 -1
  169. package/lib/hooks/useModularUI.js.map +1 -1
  170. package/lib/hooks/useModularUIBasic.js +4 -1
  171. package/lib/hooks/useModularUIBasic.js.flow +1 -1
  172. package/lib/hooks/useModularUIBasic.js.map +1 -1
  173. package/lib/hooks/useRouter.js +6 -6
  174. package/lib/hooks/useRouter.js.flow +7 -1
  175. package/lib/hooks/useRouter.js.map +1 -1
  176. package/lib/models/attributes/AttributeCollection.js.flow +8 -6
  177. package/lib/models/attributes/AttributeCollection.js.map +1 -1
  178. package/lib/models/attributes/AttributeModel.js.flow +18 -16
  179. package/lib/models/attributes/AttributeModel.js.map +1 -1
  180. package/lib/models/attributes/CompositeAttributeChildCollection.js.flow +1 -1
  181. package/lib/models/attributes/CompositeAttributeChildCollection.js.map +1 -1
  182. package/lib/models/attributes/NumberAttributeModel.js +5 -2
  183. package/lib/models/attributes/NumberAttributeModel.js.flow +7 -3
  184. package/lib/models/attributes/NumberAttributeModel.js.map +1 -1
  185. package/lib/models/attributes/_createAttribute.js.flow +1 -1
  186. package/lib/models/attributes/_createAttribute.js.map +1 -1
  187. package/lib/models/attributes/layouthint-rules/BaseLayoutHintRule.js.flow +1 -1
  188. package/lib/models/attributes/layouthint-rules/BaseLayoutHintRule.js.map +1 -1
  189. package/lib/models/attributes/layouthint-rules/DependentAttribute.js.flow +1 -1
  190. package/lib/models/attributes/layouthint-rules/DependentAttribute.js.map +1 -1
  191. package/lib/models/base/ResourceModel.js.flow +1 -1
  192. package/lib/models/base/ResourceModel.js.map +1 -1
  193. package/lib/models/content/ContentTOCModel.js.flow +4 -1
  194. package/lib/models/content/ContentTOCModel.js.map +1 -1
  195. package/lib/models/filters/FilterCollection.js.flow +1 -1
  196. package/lib/models/filters/FilterCollection.js.map +1 -1
  197. package/lib/models/form/FormModel.js.flow +2 -2
  198. package/lib/models/form/FormModel.js.map +1 -1
  199. package/lib/models/links/LinkModel.js +3 -1
  200. package/lib/models/links/LinkModel.js.flow +4 -2
  201. package/lib/models/links/LinkModel.js.map +1 -1
  202. package/lib/models/links/normalizeLinkJSON.js.flow +1 -1
  203. package/lib/models/links/normalizeLinkJSON.js.map +1 -1
  204. package/lib/models/list/ListModel.js.flow +1 -1
  205. package/lib/models/list/ListModel.js.map +1 -1
  206. package/lib/models/parameter/Parameter.js +1 -1
  207. package/lib/models/parameter/Parameter.js.flow +1 -1
  208. package/lib/models/parameter/Parameter.js.map +1 -1
  209. package/lib/models/types.js.flow +6 -6
  210. package/lib/models/types.js.map +1 -1
  211. package/lib/modularui/ModularUIRequest.js.flow +6 -6
  212. package/lib/modularui/ModularUIRequest.js.map +1 -1
  213. package/lib/react-client/client.js +2 -2
  214. package/lib/react-client/client.js.flow +8 -8
  215. package/lib/react-client/client.js.map +1 -1
  216. package/lib/react-client/rehydrate.js.flow +2 -2
  217. package/lib/react-client/rehydrate.js.map +1 -1
  218. package/lib/react-server/createSSRComplete.js.flow +3 -3
  219. package/lib/react-server/createSSRComplete.js.map +1 -1
  220. package/lib/react-server/renderSSRComplete.js +4 -2
  221. package/lib/react-server/renderSSRComplete.js.flow +2 -2
  222. package/lib/react-server/renderSSRComplete.js.map +1 -1
  223. package/lib/react-server/serverUtil.js +19 -10
  224. package/lib/react-server/serverUtil.js.flow +20 -11
  225. package/lib/react-server/serverUtil.js.map +1 -1
  226. package/lib/react-theme/ThemeProvider.js +1 -1
  227. package/lib/react-theme/ThemeProvider.js.flow +1 -1
  228. package/lib/react-theme/ThemeProvider.js.map +1 -1
  229. package/lib/react-theme/__tests__/ThemeProvider.spec.js.flow +2 -0
  230. package/lib/react-theme/__tests__/createTheme.spec.js.flow +3 -0
  231. package/lib/react-theme/createTheme.js +8 -3
  232. package/lib/react-theme/createTheme.js.flow +7 -5
  233. package/lib/react-theme/createTheme.js.map +1 -1
  234. package/lib/react-theme/utils/contrast.js +3 -1
  235. package/lib/react-theme/utils/contrast.js.flow +1 -1
  236. package/lib/react-theme/utils/contrast.js.map +1 -1
  237. package/lib/react-theme/utils/corners.js +3 -1
  238. package/lib/react-theme/utils/corners.js.flow +1 -1
  239. package/lib/react-theme/utils/corners.js.map +1 -1
  240. package/lib/react-theme/utils/spacers.js +9 -3
  241. package/lib/react-theme/utils/spacers.js.flow +3 -3
  242. package/lib/react-theme/utils/spacers.js.map +1 -1
  243. package/lib/redux/_i18n/{actions.js → I18nActions.js} +1 -1
  244. package/lib/redux/_i18n/{actions.js.flow → I18nActions.js.flow} +0 -0
  245. package/lib/redux/_i18n/I18nActions.js.map +1 -0
  246. package/lib/redux/_i18n/{reducer.js → I18nReducer.js} +1 -1
  247. package/{src/redux/_i18n/reducer.js → lib/redux/_i18n/I18nReducer.js.flow} +5 -2
  248. package/lib/redux/_i18n/I18nReducer.js.map +1 -0
  249. package/lib/redux/_i18n/__tests__/actions.spec.js.flow +1 -1
  250. package/lib/redux/_i18n/__tests__/reducer.spec.js.flow +1 -1
  251. package/lib/redux/_i18n/index.js +8 -8
  252. package/lib/redux/_i18n/index.js.flow +2 -2
  253. package/lib/redux/_i18n/index.js.map +1 -1
  254. package/lib/redux/_modularui/{actions.js → ModularUIActions.js} +1 -1
  255. package/lib/redux/_modularui/{actions.js.flow → ModularUIActions.js.flow} +1 -1
  256. package/lib/redux/_modularui/ModularUIActions.js.map +1 -0
  257. package/lib/redux/_modularui/{connector.js → ModularUIConnector.js} +11 -11
  258. package/{src/redux/_modularui/connector.js → lib/redux/_modularui/ModularUIConnector.js.flow} +8 -4
  259. package/lib/redux/_modularui/ModularUIConnector.js.map +1 -0
  260. package/lib/redux/_modularui/{middleware.js → ModularUIMiddleware.js} +4 -4
  261. package/lib/redux/_modularui/{middleware.js.flow → ModularUIMiddleware.js.flow} +20 -5
  262. package/lib/redux/_modularui/ModularUIMiddleware.js.map +1 -0
  263. package/lib/redux/_modularui/{reducer.js → ModularUIReducer.js} +4 -6
  264. package/lib/redux/_modularui/{reducer.js.flow → ModularUIReducer.js.flow} +14 -8
  265. package/lib/redux/_modularui/ModularUIReducer.js.map +1 -0
  266. package/lib/redux/_modularui/{selectors.js → ModularUISelectors.js} +1 -1
  267. package/lib/redux/_modularui/{selectors.js.flow → ModularUISelectors.js.flow} +3 -2
  268. package/lib/redux/_modularui/ModularUISelectors.js.map +1 -0
  269. package/lib/redux/_modularui/{modularuiUtils.js → ModularUIUtils.js} +1 -1
  270. package/lib/redux/_modularui/{modularuiUtils.js.flow → ModularUIUtils.js.flow} +0 -0
  271. package/lib/redux/_modularui/{modularuiUtils.js.map → ModularUIUtils.js.map} +1 -1
  272. package/lib/redux/_modularui/__tests__/actions.spec.js.flow +1 -1
  273. package/lib/redux/_modularui/__tests__/reducer.spec.js.flow +6 -4
  274. package/lib/redux/_modularui/__tests__/selectors.spec.js.flow +1 -1
  275. package/lib/redux/_modularui/index.js +22 -22
  276. package/lib/redux/_modularui/index.js.flow +6 -6
  277. package/lib/redux/_modularui/index.js.map +1 -1
  278. package/lib/redux/_modularui/types.js.flow +10 -4
  279. package/lib/redux/_modularui/types.js.map +1 -1
  280. package/lib/redux/_modularui/withModularUI.js +2 -2
  281. package/lib/redux/_modularui/withModularUI.js.flow +1 -1
  282. package/lib/redux/_modularui/withModularUI.js.map +1 -1
  283. package/lib/redux/_router/{actions.js → RouterActions.js} +1 -1
  284. package/lib/redux/_router/{actions.js.flow → RouterActions.js.flow} +0 -0
  285. package/lib/redux/_router/RouterActions.js.map +1 -0
  286. package/lib/redux/_router/{connectors.js → RouterConnectors.js} +7 -7
  287. package/lib/redux/_router/{connectors.js.flow → RouterConnectors.js.flow} +1 -1
  288. package/lib/redux/_router/RouterConnectors.js.map +1 -0
  289. package/lib/redux/_router/{middleware.js → RouterMiddleware.js} +1 -1
  290. package/lib/redux/_router/{middleware.js.flow → RouterMiddleware.js.flow} +0 -0
  291. package/lib/redux/_router/RouterMiddleware.js.map +1 -0
  292. package/lib/redux/_router/{reducer.js → RouterReducer.js} +1 -1
  293. package/lib/redux/_router/{reducer.js.flow → RouterReducer.js.flow} +0 -0
  294. package/lib/redux/_router/RouterReducer.js.map +1 -0
  295. package/lib/redux/_router/__tests__/actions.spec.js.flow +1 -1
  296. package/lib/redux/_router/__tests__/middleware.spec.js.flow +2 -2
  297. package/lib/redux/_router/__tests__/reducer.spec.js.flow +1 -1
  298. package/lib/redux/_router/index.js +16 -16
  299. package/lib/redux/_router/index.js.flow +4 -4
  300. package/lib/redux/_router/index.js.map +1 -1
  301. package/lib/redux/actions/Application.js +5 -5
  302. package/lib/redux/actions/Application.js.flow +5 -2
  303. package/lib/redux/actions/Application.js.map +1 -1
  304. package/lib/redux/actions/Authorization.js +6 -6
  305. package/lib/redux/actions/Authorization.js.flow +3 -3
  306. package/lib/redux/actions/Authorization.js.map +1 -1
  307. package/lib/redux/actions/Error.js +2 -2
  308. package/lib/redux/actions/Error.js.flow +2 -2
  309. package/lib/redux/actions/Error.js.map +1 -1
  310. package/lib/redux/actions/Form.js +5 -5
  311. package/lib/redux/actions/Form.js.flow +2 -2
  312. package/lib/redux/actions/Form.js.map +1 -1
  313. package/lib/redux/actions/FormAttributeSet.js +2 -2
  314. package/lib/redux/actions/FormAttributeSet.js.flow +1 -1
  315. package/lib/redux/actions/FormAttributeSet.js.map +1 -1
  316. package/lib/redux/actions/FormAttributeSetRepeatable.js +4 -4
  317. package/lib/redux/actions/FormAttributeSetRepeatable.js.flow +1 -1
  318. package/lib/redux/actions/FormAttributeSetRepeatable.js.map +1 -1
  319. package/lib/redux/actions/FormAutosave.js +2 -2
  320. package/lib/redux/actions/FormAutosave.js.flow +1 -1
  321. package/lib/redux/actions/FormAutosave.js.map +1 -1
  322. package/lib/redux/actions/FormAutosubmit.js +2 -2
  323. package/lib/redux/actions/FormAutosubmit.js.flow +1 -1
  324. package/lib/redux/actions/FormAutosubmit.js.map +1 -1
  325. package/lib/redux/actions/FormValidations.js +2 -2
  326. package/lib/redux/actions/FormValidations.js.flow +5 -3
  327. package/lib/redux/actions/FormValidations.js.map +1 -1
  328. package/lib/redux/actions/Notification.js.flow +1 -1
  329. package/lib/redux/actions/Notification.js.map +1 -1
  330. package/lib/redux/actions/Preferences.js +1 -1
  331. package/lib/redux/actions/Preferences.js.flow +3 -3
  332. package/lib/redux/actions/Preferences.js.map +1 -1
  333. package/lib/redux/actions/SignIn.js +2 -2
  334. package/lib/redux/actions/SignIn.js.flow +1 -1
  335. package/lib/redux/actions/SignIn.js.map +1 -1
  336. package/lib/redux/actions/SignOut.js +2 -2
  337. package/lib/redux/actions/SignOut.js.flow +1 -1
  338. package/lib/redux/actions/SignOut.js.map +1 -1
  339. package/lib/redux/connectors/Application.js +2 -2
  340. package/lib/redux/connectors/Application.js.flow +1 -1
  341. package/lib/redux/connectors/Application.js.map +1 -1
  342. package/lib/redux/connectors/Breadcrumb.js +2 -2
  343. package/lib/redux/connectors/Breadcrumb.js.flow +1 -1
  344. package/lib/redux/connectors/Breadcrumb.js.map +1 -1
  345. package/lib/redux/connectors/CaseView.js +2 -2
  346. package/lib/redux/connectors/CaseView.js.flow +1 -1
  347. package/lib/redux/connectors/CaseView.js.map +1 -1
  348. package/lib/redux/connectors/ConceptDetail.js +2 -2
  349. package/lib/redux/connectors/ConceptDetail.js.flow +1 -1
  350. package/lib/redux/connectors/ConceptDetail.js.map +1 -1
  351. package/lib/redux/connectors/ContentBrowser.js +2 -2
  352. package/lib/redux/connectors/ContentBrowser.js.flow +1 -1
  353. package/lib/redux/connectors/ContentBrowser.js.map +1 -1
  354. package/lib/redux/connectors/ContentDetail.js +2 -2
  355. package/lib/redux/connectors/ContentDetail.js.flow +1 -1
  356. package/lib/redux/connectors/ContentDetail.js.map +1 -1
  357. package/lib/redux/connectors/ContentDetailSection.js +2 -2
  358. package/lib/redux/connectors/ContentDetailSection.js.flow +1 -1
  359. package/lib/redux/connectors/ContentDetailSection.js.map +1 -1
  360. package/lib/redux/connectors/Form.js +2 -2
  361. package/lib/redux/connectors/Form.js.flow +1 -1
  362. package/lib/redux/connectors/Form.js.map +1 -1
  363. package/lib/redux/connectors/ListDetail.js +2 -2
  364. package/lib/redux/connectors/ListDetail.js.flow +1 -1
  365. package/lib/redux/connectors/ListDetail.js.map +1 -1
  366. package/lib/redux/connectors/ModelCatalog.js +2 -2
  367. package/lib/redux/connectors/ModelCatalog.js.flow +1 -1
  368. package/lib/redux/connectors/ModelCatalog.js.map +1 -1
  369. package/lib/redux/connectors/PanelRenderer.js +2 -2
  370. package/lib/redux/connectors/PanelRenderer.js.flow +1 -1
  371. package/lib/redux/connectors/PanelRenderer.js.map +1 -1
  372. package/lib/redux/connectors/Preferences.js.flow +5 -2
  373. package/lib/redux/connectors/Preferences.js.map +1 -1
  374. package/lib/redux/connectors/QuickSearch.js +4 -4
  375. package/lib/redux/connectors/QuickSearch.js.flow +2 -2
  376. package/lib/redux/connectors/QuickSearch.js.map +1 -1
  377. package/lib/redux/connectors/SignIn.js +2 -2
  378. package/lib/redux/connectors/SignIn.js.flow +1 -1
  379. package/lib/redux/connectors/SignIn.js.map +1 -1
  380. package/lib/redux/connectors/SignOut.js.flow +2 -2
  381. package/lib/redux/connectors/SignOut.js.map +1 -1
  382. package/lib/redux/connectors/Tab.js +2 -2
  383. package/lib/redux/connectors/Tab.js.flow +1 -1
  384. package/lib/redux/connectors/Tab.js.map +1 -1
  385. package/lib/redux/reducers/ModalsReducer.js.flow +2 -2
  386. package/lib/redux/reducers/ModalsReducer.js.map +1 -1
  387. package/lib/redux/reducers/ProgressIndicatorReducer.js.flow +1 -1
  388. package/lib/redux/reducers/ProgressIndicatorReducer.js.map +1 -1
  389. package/lib/redux/reducers/createReducer.js +6 -6
  390. package/lib/redux/reducers/createReducer.js.flow +3 -3
  391. package/lib/redux/reducers/createReducer.js.map +1 -1
  392. package/lib/redux/store/configureStore.js +5 -5
  393. package/lib/redux/store/configureStore.js.flow +4 -4
  394. package/lib/redux/store/configureStore.js.map +1 -1
  395. package/lib/utils/fetch/universalFetch.js +5 -3
  396. package/lib/utils/fetch/universalFetch.js.flow +8 -6
  397. package/lib/utils/fetch/universalFetch.js.map +1 -1
  398. package/lib/utils/fetch/xhr.js.flow +21 -21
  399. package/lib/utils/fetch/xhr.js.map +1 -1
  400. package/lib/utils/helpers/objects.js.flow +5 -3
  401. package/lib/utils/helpers/objects.js.map +1 -1
  402. package/lib/utils/helpers/sanitizeHtml.js.flow +1 -1
  403. package/lib/utils/helpers/sanitizeHtml.js.map +1 -1
  404. package/lib/utils/number/parseNumbers.js.flow +8 -2
  405. package/lib/utils/number/parseNumbers.js.map +1 -1
  406. package/package.json +8 -8
  407. package/src/builder/mergeLayoutHintConfigurations.js +1 -1
  408. package/src/constants/Settings.js +1 -1
  409. package/src/hooks/useAuthentication.js +1 -1
  410. package/src/hooks/useModelCatalog.js +2 -1
  411. package/src/hooks/useModels.js +1 -1
  412. package/src/hooks/useModularUI.js +4 -1
  413. package/src/hooks/useModularUIBasic.js +1 -1
  414. package/src/hooks/useRouter.js +7 -1
  415. package/src/models/attributes/AttributeCollection.js +8 -6
  416. package/src/models/attributes/AttributeModel.js +18 -16
  417. package/src/models/attributes/CompositeAttributeChildCollection.js +1 -1
  418. package/src/models/attributes/NumberAttributeModel.js +7 -3
  419. package/src/models/attributes/_createAttribute.js +1 -1
  420. package/src/models/attributes/layouthint-rules/BaseLayoutHintRule.js +1 -1
  421. package/src/models/attributes/layouthint-rules/DependentAttribute.js +1 -1
  422. package/src/models/base/ResourceModel.js +1 -1
  423. package/src/models/content/ContentTOCModel.js +4 -1
  424. package/src/models/filters/FilterCollection.js +1 -1
  425. package/src/models/form/FormModel.js +2 -2
  426. package/src/models/links/LinkModel.js +4 -2
  427. package/src/models/links/normalizeLinkJSON.js +1 -1
  428. package/src/models/list/ListModel.js +1 -1
  429. package/src/models/parameter/Parameter.js +1 -1
  430. package/src/models/types.js +6 -6
  431. package/src/modularui/ModularUIRequest.js +6 -6
  432. package/src/react-client/client.js +8 -8
  433. package/src/react-client/rehydrate.js +2 -2
  434. package/src/react-server/createSSRComplete.js +3 -3
  435. package/src/react-server/renderSSRComplete.js +2 -2
  436. package/src/react-server/serverUtil.js +20 -11
  437. package/src/react-theme/ThemeProvider.js +1 -1
  438. package/src/react-theme/__tests__/ThemeProvider.spec.js +2 -0
  439. package/src/react-theme/__tests__/createTheme.spec.js +3 -0
  440. package/src/react-theme/createTheme.js +7 -5
  441. package/src/react-theme/utils/contrast.js +1 -1
  442. package/src/react-theme/utils/corners.js +1 -1
  443. package/src/react-theme/utils/spacers.js +3 -3
  444. package/src/redux/_i18n/{actions.js → I18nActions.js} +0 -0
  445. package/{lib/redux/_i18n/reducer.js.flow → src/redux/_i18n/I18nReducer.js} +5 -2
  446. package/src/redux/_i18n/__tests__/actions.spec.js +1 -1
  447. package/src/redux/_i18n/__tests__/reducer.spec.js +1 -1
  448. package/src/redux/_i18n/index.js +2 -2
  449. package/src/redux/_modularui/{actions.js → ModularUIActions.js} +1 -1
  450. package/{lib/redux/_modularui/connector.js.flow → src/redux/_modularui/ModularUIConnector.js} +8 -4
  451. package/src/redux/_modularui/{middleware.js → ModularUIMiddleware.js} +20 -5
  452. package/src/redux/_modularui/{reducer.js → ModularUIReducer.js} +14 -8
  453. package/src/redux/_modularui/{selectors.js → ModularUISelectors.js} +3 -2
  454. package/src/redux/_modularui/{modularuiUtils.js → ModularUIUtils.js} +0 -0
  455. package/src/redux/_modularui/__tests__/actions.spec.js +1 -1
  456. package/src/redux/_modularui/__tests__/reducer.spec.js +6 -4
  457. package/src/redux/_modularui/__tests__/selectors.spec.js +1 -1
  458. package/src/redux/_modularui/index.js +6 -6
  459. package/src/redux/_modularui/types.js +10 -4
  460. package/src/redux/_modularui/withModularUI.js +1 -1
  461. package/src/redux/_router/{actions.js → RouterActions.js} +0 -0
  462. package/src/redux/_router/{connectors.js → RouterConnectors.js} +1 -1
  463. package/src/redux/_router/{middleware.js → RouterMiddleware.js} +0 -0
  464. package/src/redux/_router/{reducer.js → RouterReducer.js} +0 -0
  465. package/src/redux/_router/__tests__/actions.spec.js +1 -1
  466. package/src/redux/_router/__tests__/middleware.spec.js +2 -2
  467. package/src/redux/_router/__tests__/reducer.spec.js +1 -1
  468. package/src/redux/_router/index.js +4 -4
  469. package/src/redux/actions/Application.js +5 -2
  470. package/src/redux/actions/Authorization.js +3 -3
  471. package/src/redux/actions/Error.js +2 -2
  472. package/src/redux/actions/Form.js +2 -2
  473. package/src/redux/actions/FormAttributeSet.js +1 -1
  474. package/src/redux/actions/FormAttributeSetRepeatable.js +1 -1
  475. package/src/redux/actions/FormAutosave.js +1 -1
  476. package/src/redux/actions/FormAutosubmit.js +1 -1
  477. package/src/redux/actions/FormValidations.js +5 -3
  478. package/src/redux/actions/Notification.js +1 -1
  479. package/src/redux/actions/Preferences.js +3 -3
  480. package/src/redux/actions/SignIn.js +1 -1
  481. package/src/redux/actions/SignOut.js +1 -1
  482. package/src/redux/connectors/Application.js +1 -1
  483. package/src/redux/connectors/Breadcrumb.js +1 -1
  484. package/src/redux/connectors/CaseView.js +1 -1
  485. package/src/redux/connectors/ConceptDetail.js +1 -1
  486. package/src/redux/connectors/ContentBrowser.js +1 -1
  487. package/src/redux/connectors/ContentDetail.js +1 -1
  488. package/src/redux/connectors/ContentDetailSection.js +1 -1
  489. package/src/redux/connectors/Form.js +1 -1
  490. package/src/redux/connectors/ListDetail.js +1 -1
  491. package/src/redux/connectors/ModelCatalog.js +1 -1
  492. package/src/redux/connectors/PanelRenderer.js +1 -1
  493. package/src/redux/connectors/Preferences.js +5 -2
  494. package/src/redux/connectors/QuickSearch.js +2 -2
  495. package/src/redux/connectors/SignIn.js +1 -1
  496. package/src/redux/connectors/SignOut.js +2 -2
  497. package/src/redux/connectors/Tab.js +1 -1
  498. package/src/redux/reducers/ModalsReducer.js +2 -2
  499. package/src/redux/reducers/ProgressIndicatorReducer.js +1 -1
  500. package/src/redux/reducers/createReducer.js +3 -3
  501. package/src/redux/store/configureStore.js +4 -4
  502. package/src/utils/fetch/universalFetch.js +8 -6
  503. package/src/utils/fetch/xhr.js +21 -21
  504. package/src/utils/helpers/objects.js +5 -3
  505. package/src/utils/helpers/sanitizeHtml.js +1 -1
  506. package/src/utils/number/parseNumbers.js +8 -2
  507. package/types/models/concepts/ConceptDetailModel.d.ts +3 -3
  508. package/types/models/concepts/ConceptRelationModel.d.ts +2 -1
  509. package/types/models/types.d.ts +17 -3
  510. package/types/redux/_modularui/types.d.ts +3 -1
  511. package/types/utils/fetch/universalFetch.d.ts +3 -3
  512. package/types/utils/helpers/objects.d.ts +10 -2
  513. package/esm/redux/_i18n/actions.js.map +0 -1
  514. package/esm/redux/_i18n/reducer.js.map +0 -1
  515. package/esm/redux/_modularui/actions.js.map +0 -1
  516. package/esm/redux/_modularui/connector.js.map +0 -1
  517. package/esm/redux/_modularui/middleware.js.map +0 -1
  518. package/esm/redux/_modularui/reducer.js.map +0 -1
  519. package/esm/redux/_modularui/selectors.js.map +0 -1
  520. package/esm/redux/_router/actions.js.map +0 -1
  521. package/esm/redux/_router/connectors.js.map +0 -1
  522. package/esm/redux/_router/middleware.js.map +0 -1
  523. package/esm/redux/_router/reducer.js.map +0 -1
  524. package/lib/redux/_i18n/actions.js.map +0 -1
  525. package/lib/redux/_i18n/reducer.js.map +0 -1
  526. package/lib/redux/_modularui/actions.js.map +0 -1
  527. package/lib/redux/_modularui/connector.js.map +0 -1
  528. package/lib/redux/_modularui/middleware.js.map +0 -1
  529. package/lib/redux/_modularui/reducer.js.map +0 -1
  530. package/lib/redux/_modularui/selectors.js.map +0 -1
  531. package/lib/redux/_router/actions.js.map +0 -1
  532. package/lib/redux/_router/connectors.js.map +0 -1
  533. package/lib/redux/_router/middleware.js.map +0 -1
  534. package/lib/redux/_router/reducer.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"sanitizeHtml.js","names":["properEntityEncoding","html","escapedGt","replace","escapedLt","properEntities","he","encode","decode","decimal","unescapedGt","removeUnwantedHtml","options","allowedTags","IllegalArgumentException","correctEntityHtml","htmlWithoutAttributes","htmlWithCorrectBR","Array","isArray","join","pattern","regex","RegExp"],"sources":["../../../src/utils/helpers/sanitizeHtml.js"],"sourcesContent":["// @flow\nimport he from \"he\";\n\nimport { IllegalArgumentException } from \"../../exceptions\";\n\ntype removeUnwantedHtmlOptions = {\n allowedTags?: Array<string>,\n};\n\n/**\n * Translates html entities to their correct decimal equivalent\n * When path is only one deep better use optional chaining\n */\nconst properEntityEncoding = (html) => {\n const escapedGt = html.replace(/</g, \"[\");\n const escapedLt = escapedGt.replace(/>/g, \"]\");\n\n const properEntities = he.encode(he.decode(escapedLt), {\n decimal: true,\n });\n\n const unescapedGt = properEntities.replace(/\\[/g, \"<\");\n\n return unescapedGt.replace(/]/g, \">\");\n};\n\n/**\n * removes unwanted html, this might result in incorrect html, as it removes all html that we don't except,\n * like <b style=\"font-weight: 400\">bold</b> will result in bold</b>\n */\nconst removeUnwantedHtml = (\n html: string,\n options: removeUnwantedHtmlOptions = {\n allowedTags: [\"p\", \"br\", \"b\", \"i\", \"u\", \"strike\"],\n }\n): string => {\n if (typeof html !== \"string\") {\n throw new IllegalArgumentException(\"sanitizeHTML method expects a string\");\n }\n\n const correctEntityHtml = properEntityEncoding(html);\n\n // remove attributes from html elements\n const htmlWithoutAttributes = correctEntityHtml.replace(\n /<(\\w+)(.|[\\r\\n])*?>/gi,\n \"<$1>\"\n );\n\n const htmlWithCorrectBR = htmlWithoutAttributes.replace(\n /<br\\s*>/gi,\n \"<br />\"\n );\n\n // remove not allowed tags\n const allowedTags = Array.isArray(options.allowedTags)\n ? options.allowedTags.join(\"|\")\n : \"\";\n const pattern = `<(?!\\\\/?(${allowedTags})(>|\\\\s\\\\/))[^<]+?>`;\n const regex = new RegExp(pattern, \"gi\");\n\n return htmlWithCorrectBR.replace(regex, \"\");\n};\n\nexport { removeUnwantedHtml };\n"],"mappings":";;;;;;;AACA;AAEA;AAMA;AACA;AACA;AACA;AACA,MAAMA,oBAAoB,GAAIC,IAAI,IAAK;EACrC,MAAMC,SAAS,GAAGD,IAAI,CAACE,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;EACzC,MAAMC,SAAS,GAAGF,SAAS,CAACC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;EAE9C,MAAME,cAAc,GAAGC,WAAE,CAACC,MAAM,CAACD,WAAE,CAACE,MAAM,CAACJ,SAAS,CAAC,EAAE;IACrDK,OAAO,EAAE;EACX,CAAC,CAAC;EAEF,MAAMC,WAAW,GAAGL,cAAc,CAACF,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;EAEtD,OAAOO,WAAW,CAACP,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;AACvC,CAAC;;AAED;AACA;AACA;AACA;AACA,MAAMQ,kBAAkB,GAAG,UACzBV,IAAY,EAID;EAAA,IAHXW,OAAkC,uEAAG;IACnCC,WAAW,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ;EAClD,CAAC;EAED,IAAI,OAAOZ,IAAI,KAAK,QAAQ,EAAE;IAC5B,MAAM,IAAIa,oCAAwB,CAAC,sCAAsC,CAAC;EAC5E;EAEA,MAAMC,iBAAiB,GAAGf,oBAAoB,CAACC,IAAI,CAAC;;EAEpD;EACA,MAAMe,qBAAqB,GAAGD,iBAAiB,CAACZ,OAAO,CACrD,uBAAuB,EACvB,MAAM,CACP;EAED,MAAMc,iBAAiB,GAAGD,qBAAqB,CAACb,OAAO,CACrD,WAAW,EACX,QAAQ,CACT;;EAED;EACA,MAAMU,WAAW,GAAGK,KAAK,CAACC,OAAO,CAACP,OAAO,CAACC,WAAW,CAAC,GAClDD,OAAO,CAACC,WAAW,CAACO,IAAI,CAAC,GAAG,CAAC,GAC7B,EAAE;EACN,MAAMC,OAAO,GAAI,YAAWR,WAAY,qBAAoB;EAC5D,MAAMS,KAAK,GAAG,IAAIC,MAAM,CAACF,OAAO,EAAE,IAAI,CAAC;EAEvC,OAAOJ,iBAAiB,CAACd,OAAO,CAACmB,KAAK,EAAE,EAAE,CAAC;AAC7C,CAAC;AAAC"}
1
+ {"version":3,"file":"sanitizeHtml.js","names":["properEntityEncoding","html","escapedGt","replace","escapedLt","properEntities","he","encode","decode","decimal","unescapedGt","removeUnwantedHtml","options","allowedTags","IllegalArgumentException","correctEntityHtml","htmlWithoutAttributes","htmlWithCorrectBR","Array","isArray","join","pattern","regex","RegExp"],"sources":["../../../src/utils/helpers/sanitizeHtml.js"],"sourcesContent":["// @flow\nimport he from \"he\";\n\nimport { IllegalArgumentException } from \"../../exceptions\";\n\ntype removeUnwantedHtmlOptions = {\n allowedTags?: Array<string>,\n};\n\n/**\n * Translates html entities to their correct decimal equivalent\n * When path is only one deep better use optional chaining\n */\nconst properEntityEncoding = (html: string) => {\n const escapedGt = html.replace(/</g, \"[\");\n const escapedLt = escapedGt.replace(/>/g, \"]\");\n\n const properEntities = he.encode(he.decode(escapedLt), {\n decimal: true,\n });\n\n const unescapedGt = properEntities.replace(/\\[/g, \"<\");\n\n return unescapedGt.replace(/]/g, \">\");\n};\n\n/**\n * removes unwanted html, this might result in incorrect html, as it removes all html that we don't except,\n * like <b style=\"font-weight: 400\">bold</b> will result in bold</b>\n */\nconst removeUnwantedHtml = (\n html: string,\n options: removeUnwantedHtmlOptions = {\n allowedTags: [\"p\", \"br\", \"b\", \"i\", \"u\", \"strike\"],\n }\n): string => {\n if (typeof html !== \"string\") {\n throw new IllegalArgumentException(\"sanitizeHTML method expects a string\");\n }\n\n const correctEntityHtml = properEntityEncoding(html);\n\n // remove attributes from html elements\n const htmlWithoutAttributes = correctEntityHtml.replace(\n /<(\\w+)(.|[\\r\\n])*?>/gi,\n \"<$1>\"\n );\n\n const htmlWithCorrectBR = htmlWithoutAttributes.replace(\n /<br\\s*>/gi,\n \"<br />\"\n );\n\n // remove not allowed tags\n const allowedTags = Array.isArray(options.allowedTags)\n ? options.allowedTags.join(\"|\")\n : \"\";\n const pattern = `<(?!\\\\/?(${allowedTags})(>|\\\\s\\\\/))[^<]+?>`;\n const regex = new RegExp(pattern, \"gi\");\n\n return htmlWithCorrectBR.replace(regex, \"\");\n};\n\nexport { removeUnwantedHtml };\n"],"mappings":";;;;;;;AACA;AAEA;AAMA;AACA;AACA;AACA;AACA,MAAMA,oBAAoB,GAAIC,IAAY,IAAK;EAC7C,MAAMC,SAAS,GAAGD,IAAI,CAACE,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;EACzC,MAAMC,SAAS,GAAGF,SAAS,CAACC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;EAE9C,MAAME,cAAc,GAAGC,WAAE,CAACC,MAAM,CAACD,WAAE,CAACE,MAAM,CAACJ,SAAS,CAAC,EAAE;IACrDK,OAAO,EAAE;EACX,CAAC,CAAC;EAEF,MAAMC,WAAW,GAAGL,cAAc,CAACF,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;EAEtD,OAAOO,WAAW,CAACP,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;AACvC,CAAC;;AAED;AACA;AACA;AACA;AACA,MAAMQ,kBAAkB,GAAG,UACzBV,IAAY,EAID;EAAA,IAHXW,OAAkC,uEAAG;IACnCC,WAAW,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ;EAClD,CAAC;EAED,IAAI,OAAOZ,IAAI,KAAK,QAAQ,EAAE;IAC5B,MAAM,IAAIa,oCAAwB,CAAC,sCAAsC,CAAC;EAC5E;EAEA,MAAMC,iBAAiB,GAAGf,oBAAoB,CAACC,IAAI,CAAC;;EAEpD;EACA,MAAMe,qBAAqB,GAAGD,iBAAiB,CAACZ,OAAO,CACrD,uBAAuB,EACvB,MAAM,CACP;EAED,MAAMc,iBAAiB,GAAGD,qBAAqB,CAACb,OAAO,CACrD,WAAW,EACX,QAAQ,CACT;;EAED;EACA,MAAMU,WAAW,GAAGK,KAAK,CAACC,OAAO,CAACP,OAAO,CAACC,WAAW,CAAC,GAClDD,OAAO,CAACC,WAAW,CAACO,IAAI,CAAC,GAAG,CAAC,GAC7B,EAAE;EACN,MAAMC,OAAO,GAAI,YAAWR,WAAY,qBAAoB;EAC5D,MAAMS,KAAK,GAAG,IAAIC,MAAM,CAACF,OAAO,EAAE,IAAI,CAAC;EAEvC,OAAOJ,iBAAiB,CAACd,OAAO,CAACmB,KAAK,EAAE,EAAE,CAAC;AAC7C,CAAC;AAAC"}
@@ -4,7 +4,10 @@ import big from "big.js";
4
4
  /**
5
5
  * @private
6
6
  */
7
- const removeGroupingSeparator = (input, groupingSeparator) => {
7
+ const removeGroupingSeparator = (
8
+ input: string | number,
9
+ groupingSeparator?: ?string
10
+ ) => {
8
11
  if (typeof input === "number") {
9
12
  return input;
10
13
  }
@@ -24,7 +27,10 @@ const removeGroupingSeparator = (input, groupingSeparator) => {
24
27
  /**
25
28
  * @private
26
29
  */
27
- const updateDecimalSeparator = (input, decimalSeparator) => {
30
+ const updateDecimalSeparator = (
31
+ input: string | number,
32
+ decimalSeparator?: ?string
33
+ ) => {
28
34
  if (typeof input === "number") {
29
35
  return input;
30
36
  }
@@ -1 +1 @@
1
- {"version":3,"file":"parseNumbers.js","names":["removeGroupingSeparator","input","groupingSeparator","escapedGroupingSeparator","replace","RegExp","updateDecimalSeparator","decimalSeparator","parseToNumber","NaN","inputNoGrouping","inputCorrectDecimalSeparator","Number","parseNumberToString","big","toFixed","error"],"sources":["../../../src/utils/number/parseNumbers.js"],"sourcesContent":["// @flow\nimport big from \"big.js\";\n\n/**\n * @private\n */\nconst removeGroupingSeparator = (input, groupingSeparator) => {\n if (typeof input === \"number\") {\n return input;\n }\n\n if (groupingSeparator == null) {\n return input;\n }\n\n const escapedGroupingSeparator = groupingSeparator.replace(\n /[$()*+.?[\\\\\\]^{|}]/g,\n \"\\\\$&\"\n );\n\n return input.replace(new RegExp(escapedGroupingSeparator, \"g\"), \"\");\n};\n\n/**\n * @private\n */\nconst updateDecimalSeparator = (input, decimalSeparator) => {\n if (typeof input === \"number\") {\n return input;\n }\n\n if (decimalSeparator == null || decimalSeparator === \"\") {\n return input;\n }\n\n return input.replace(decimalSeparator, \".\");\n};\n\n/**\n * Parses input into a number, removes the grouping separator from the input and\n * replaces the decimal separator with a dot to make it a JavaScript parseable number\n */\nconst parseToNumber = (\n input: ?string | ?number,\n groupingSeparator: ?string = \",\",\n decimalSeparator: ?string = \".\"\n): number => {\n if (input == null || input === \"\") {\n return NaN;\n }\n\n const inputNoGrouping = removeGroupingSeparator(input, groupingSeparator);\n\n const inputCorrectDecimalSeparator = updateDecimalSeparator(\n inputNoGrouping,\n decimalSeparator\n );\n\n return Number(inputCorrectDecimalSeparator);\n};\n\n/**\n * parses Numbers To String\n */\nconst parseNumberToString = (\n input: ?string | ?number,\n groupingSeparator: ?string = \",\",\n decimalSeparator: ?string = \".\"\n): string => {\n if (input == null || input === \"\") {\n return \"NaN\";\n }\n\n const inputNoGrouping = removeGroupingSeparator(input, groupingSeparator);\n\n const inputCorrectDecimalSeparator = updateDecimalSeparator(\n inputNoGrouping,\n decimalSeparator\n );\n\n try {\n return big(inputCorrectDecimalSeparator).toFixed();\n } catch (error) {\n return \"NaN\";\n }\n};\n\nexport { parseToNumber, parseNumberToString };\n"],"mappings":";;;;;;;AACA;AAEA;AACA;AACA;AACA,MAAMA,uBAAuB,GAAG,CAACC,KAAK,EAAEC,iBAAiB,KAAK;EAC5D,IAAI,OAAOD,KAAK,KAAK,QAAQ,EAAE;IAC7B,OAAOA,KAAK;EACd;EAEA,IAAIC,iBAAiB,IAAI,IAAI,EAAE;IAC7B,OAAOD,KAAK;EACd;EAEA,MAAME,wBAAwB,GAAGD,iBAAiB,CAACE,OAAO,CACxD,qBAAqB,EACrB,MAAM,CACP;EAED,OAAOH,KAAK,CAACG,OAAO,CAAC,IAAIC,MAAM,CAACF,wBAAwB,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC;AACrE,CAAC;;AAED;AACA;AACA;AACA,MAAMG,sBAAsB,GAAG,CAACL,KAAK,EAAEM,gBAAgB,KAAK;EAC1D,IAAI,OAAON,KAAK,KAAK,QAAQ,EAAE;IAC7B,OAAOA,KAAK;EACd;EAEA,IAAIM,gBAAgB,IAAI,IAAI,IAAIA,gBAAgB,KAAK,EAAE,EAAE;IACvD,OAAON,KAAK;EACd;EAEA,OAAOA,KAAK,CAACG,OAAO,CAACG,gBAAgB,EAAE,GAAG,CAAC;AAC7C,CAAC;;AAED;AACA;AACA;AACA;AACA,MAAMC,aAAa,GAAG,UACpBP,KAAwB,EAGb;EAAA,IAFXC,iBAA0B,uEAAG,GAAG;EAAA,IAChCK,gBAAyB,uEAAG,GAAG;EAE/B,IAAIN,KAAK,IAAI,IAAI,IAAIA,KAAK,KAAK,EAAE,EAAE;IACjC,OAAOQ,GAAG;EACZ;EAEA,MAAMC,eAAe,GAAGV,uBAAuB,CAACC,KAAK,EAAEC,iBAAiB,CAAC;EAEzE,MAAMS,4BAA4B,GAAGL,sBAAsB,CACzDI,eAAe,EACfH,gBAAgB,CACjB;EAED,OAAOK,MAAM,CAACD,4BAA4B,CAAC;AAC7C,CAAC;;AAED;AACA;AACA;AAFA;AAGA,MAAME,mBAAmB,GAAG,UAC1BZ,KAAwB,EAGb;EAAA,IAFXC,iBAA0B,uEAAG,GAAG;EAAA,IAChCK,gBAAyB,uEAAG,GAAG;EAE/B,IAAIN,KAAK,IAAI,IAAI,IAAIA,KAAK,KAAK,EAAE,EAAE;IACjC,OAAO,KAAK;EACd;EAEA,MAAMS,eAAe,GAAGV,uBAAuB,CAACC,KAAK,EAAEC,iBAAiB,CAAC;EAEzE,MAAMS,4BAA4B,GAAGL,sBAAsB,CACzDI,eAAe,EACfH,gBAAgB,CACjB;EAED,IAAI;IACF,OAAO,IAAAO,YAAG,EAACH,4BAA4B,CAAC,CAACI,OAAO,EAAE;EACpD,CAAC,CAAC,OAAOC,KAAK,EAAE;IACd,OAAO,KAAK;EACd;AACF,CAAC;AAAC"}
1
+ {"version":3,"file":"parseNumbers.js","names":["removeGroupingSeparator","input","groupingSeparator","escapedGroupingSeparator","replace","RegExp","updateDecimalSeparator","decimalSeparator","parseToNumber","NaN","inputNoGrouping","inputCorrectDecimalSeparator","Number","parseNumberToString","big","toFixed","error"],"sources":["../../../src/utils/number/parseNumbers.js"],"sourcesContent":["// @flow\nimport big from \"big.js\";\n\n/**\n * @private\n */\nconst removeGroupingSeparator = (\n input: string | number,\n groupingSeparator?: ?string\n) => {\n if (typeof input === \"number\") {\n return input;\n }\n\n if (groupingSeparator == null) {\n return input;\n }\n\n const escapedGroupingSeparator = groupingSeparator.replace(\n /[$()*+.?[\\\\\\]^{|}]/g,\n \"\\\\$&\"\n );\n\n return input.replace(new RegExp(escapedGroupingSeparator, \"g\"), \"\");\n};\n\n/**\n * @private\n */\nconst updateDecimalSeparator = (\n input: string | number,\n decimalSeparator?: ?string\n) => {\n if (typeof input === \"number\") {\n return input;\n }\n\n if (decimalSeparator == null || decimalSeparator === \"\") {\n return input;\n }\n\n return input.replace(decimalSeparator, \".\");\n};\n\n/**\n * Parses input into a number, removes the grouping separator from the input and\n * replaces the decimal separator with a dot to make it a JavaScript parseable number\n */\nconst parseToNumber = (\n input: ?string | ?number,\n groupingSeparator: ?string = \",\",\n decimalSeparator: ?string = \".\"\n): number => {\n if (input == null || input === \"\") {\n return NaN;\n }\n\n const inputNoGrouping = removeGroupingSeparator(input, groupingSeparator);\n\n const inputCorrectDecimalSeparator = updateDecimalSeparator(\n inputNoGrouping,\n decimalSeparator\n );\n\n return Number(inputCorrectDecimalSeparator);\n};\n\n/**\n * parses Numbers To String\n */\nconst parseNumberToString = (\n input: ?string | ?number,\n groupingSeparator: ?string = \",\",\n decimalSeparator: ?string = \".\"\n): string => {\n if (input == null || input === \"\") {\n return \"NaN\";\n }\n\n const inputNoGrouping = removeGroupingSeparator(input, groupingSeparator);\n\n const inputCorrectDecimalSeparator = updateDecimalSeparator(\n inputNoGrouping,\n decimalSeparator\n );\n\n try {\n return big(inputCorrectDecimalSeparator).toFixed();\n } catch (error) {\n return \"NaN\";\n }\n};\n\nexport { parseToNumber, parseNumberToString };\n"],"mappings":";;;;;;;AACA;AAEA;AACA;AACA;AACA,MAAMA,uBAAuB,GAAG,CAC9BC,KAAsB,EACtBC,iBAA2B,KACxB;EACH,IAAI,OAAOD,KAAK,KAAK,QAAQ,EAAE;IAC7B,OAAOA,KAAK;EACd;EAEA,IAAIC,iBAAiB,IAAI,IAAI,EAAE;IAC7B,OAAOD,KAAK;EACd;EAEA,MAAME,wBAAwB,GAAGD,iBAAiB,CAACE,OAAO,CACxD,qBAAqB,EACrB,MAAM,CACP;EAED,OAAOH,KAAK,CAACG,OAAO,CAAC,IAAIC,MAAM,CAACF,wBAAwB,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC;AACrE,CAAC;;AAED;AACA;AACA;AACA,MAAMG,sBAAsB,GAAG,CAC7BL,KAAsB,EACtBM,gBAA0B,KACvB;EACH,IAAI,OAAON,KAAK,KAAK,QAAQ,EAAE;IAC7B,OAAOA,KAAK;EACd;EAEA,IAAIM,gBAAgB,IAAI,IAAI,IAAIA,gBAAgB,KAAK,EAAE,EAAE;IACvD,OAAON,KAAK;EACd;EAEA,OAAOA,KAAK,CAACG,OAAO,CAACG,gBAAgB,EAAE,GAAG,CAAC;AAC7C,CAAC;;AAED;AACA;AACA;AACA;AACA,MAAMC,aAAa,GAAG,UACpBP,KAAwB,EAGb;EAAA,IAFXC,iBAA0B,uEAAG,GAAG;EAAA,IAChCK,gBAAyB,uEAAG,GAAG;EAE/B,IAAIN,KAAK,IAAI,IAAI,IAAIA,KAAK,KAAK,EAAE,EAAE;IACjC,OAAOQ,GAAG;EACZ;EAEA,MAAMC,eAAe,GAAGV,uBAAuB,CAACC,KAAK,EAAEC,iBAAiB,CAAC;EAEzE,MAAMS,4BAA4B,GAAGL,sBAAsB,CACzDI,eAAe,EACfH,gBAAgB,CACjB;EAED,OAAOK,MAAM,CAACD,4BAA4B,CAAC;AAC7C,CAAC;;AAED;AACA;AACA;AAFA;AAGA,MAAME,mBAAmB,GAAG,UAC1BZ,KAAwB,EAGb;EAAA,IAFXC,iBAA0B,uEAAG,GAAG;EAAA,IAChCK,gBAAyB,uEAAG,GAAG;EAE/B,IAAIN,KAAK,IAAI,IAAI,IAAIA,KAAK,KAAK,EAAE,EAAE;IACjC,OAAO,KAAK;EACd;EAEA,MAAMS,eAAe,GAAGV,uBAAuB,CAACC,KAAK,EAAEC,iBAAiB,CAAC;EAEzE,MAAMS,4BAA4B,GAAGL,sBAAsB,CACzDI,eAAe,EACfH,gBAAgB,CACjB;EAED,IAAI;IACF,OAAO,IAAAO,YAAG,EAACH,4BAA4B,CAAC,CAACI,OAAO,EAAE;EACpD,CAAC,CAAC,OAAOC,KAAK,EAAE;IACd,OAAO,KAAK;EACd;AACF,CAAC;AAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@beinformed/ui",
3
- "version": "1.25.0",
3
+ "version": "1.25.1-beta.1",
4
4
  "description": "Toolbox for be informed javascript layouts",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "bugs": "http://support.beinformed.com",
@@ -82,7 +82,7 @@
82
82
  "styled-components": "^5.0.0"
83
83
  },
84
84
  "dependencies": {
85
- "@babel/runtime-corejs3": "^7.20.6",
85
+ "@babel/runtime-corejs3": "^7.20.7",
86
86
  "big.js": "^6.2.1",
87
87
  "date-fns": "^2.29.3",
88
88
  "deepmerge": "^4.2.2",
@@ -99,8 +99,8 @@
99
99
  "setimmediate": "^1.0.5"
100
100
  },
101
101
  "devDependencies": {
102
- "@babel/cli": "^7.19.3",
103
- "@babel/core": "^7.20.5",
102
+ "@babel/cli": "^7.20.7",
103
+ "@babel/core": "^7.20.7",
104
104
  "@babel/eslint-parser": "^7.19.1",
105
105
  "@babel/eslint-plugin": "^7.19.1",
106
106
  "@babel/plugin-proposal-class-properties": "^7.18.6",
@@ -118,17 +118,17 @@
118
118
  "cherry-pick": "^0.5.0",
119
119
  "cross-env": "^7.0.3",
120
120
  "documentation": "^14.0.1",
121
- "eslint": "^8.29.0",
122
- "eslint-config-prettier": "^8.3.0",
121
+ "eslint": "^8.31.0",
122
+ "eslint-config-prettier": "^8.6.0",
123
123
  "eslint-plugin-babel": "^5.3.1",
124
124
  "eslint-plugin-ft-flow": "^2.0.3",
125
125
  "eslint-plugin-import": "^2.26.0",
126
- "eslint-plugin-jest": "^27.1.7",
126
+ "eslint-plugin-jest": "^27.2.0",
127
127
  "eslint-plugin-jsdoc": "^39.6.4",
128
128
  "eslint-plugin-react": "^7.31.11",
129
129
  "eslint-plugin-react-hooks": "^4.5.0",
130
130
  "eslint-plugin-you-dont-need-lodash-underscore": "^6.12.0",
131
- "flow-bin": "^0.184.0",
131
+ "flow-bin": "^0.196.3",
132
132
  "flow-copy-source": "^2.0.9",
133
133
  "flow-typed": "^3.8.0",
134
134
  "glob": "^8.0.3",
@@ -5,7 +5,7 @@ const path = require("path");
5
5
 
6
6
  const { LayoutHintConfiguration } = require("../constants/LayoutHintConfig");
7
7
 
8
- const readFiles = (files) => {
8
+ const readFiles = (files: Array<string>) => {
9
9
  const filePromises = files.map(
10
10
  (file) =>
11
11
  new Promise((resolve, reject) => {
@@ -11,7 +11,7 @@ import {
11
11
 
12
12
  type Setting = boolean | string | number | Array<string>;
13
13
 
14
- const defaultSettings = {
14
+ const defaultSettings: { [name: string]: Setting } = {
15
15
  // Debug missing i18n messages in layout
16
16
  DEBUG_I18N_MESSAGE_NOT_FOUND: true,
17
17
 
@@ -1,7 +1,7 @@
1
1
  // @flow
2
2
  import { useSelector, useDispatch } from "react-redux";
3
3
 
4
- import { getApplication } from "../redux/_modularui/selectors";
4
+ import { getApplication } from "../redux/_modularui/ModularUISelectors";
5
5
  import { login, logout, resetAuthErrors } from "../redux/actions";
6
6
 
7
7
  import Cache from "../utils/browser/Cache";
@@ -11,6 +11,7 @@ import ContentModel from "../models/content/ContentModel";
11
11
 
12
12
  import { useModularUIBasic } from "./useModularUIBasic";
13
13
  import { ContentTypeModel } from "../models";
14
+ import type { Location } from "react-router";
14
15
 
15
16
  /**
16
17
  */
@@ -28,7 +29,7 @@ export const useConceptIndex = (href: string): ?ConceptIndexModel =>
28
29
  targetModel: ConceptIndexModel,
29
30
  });
30
31
 
31
- const getHref = (context, dynamic, location) => {
32
+ const getHref = (context: string, dynamic: string, location?: Location) => {
32
33
  let href = dynamic;
33
34
  if (!href.startsWith(`/${context}/`)) {
34
35
  href = `/${context}/${href}`;
@@ -1,7 +1,7 @@
1
1
  // @flow
2
2
  import { useDispatch } from "react-redux";
3
3
 
4
- import { reloadModel } from "../redux/_modularui/actions";
4
+ import { reloadModel } from "../redux/_modularui/ModularUIActions";
5
5
 
6
6
  import type { ModularUIModel } from "../models/types";
7
7
 
@@ -3,7 +3,10 @@ import { useEffect, useRef } from "react";
3
3
  import { useDispatch, useSelector } from "react-redux";
4
4
 
5
5
  import { HTTP_METHODS } from "../constants";
6
- import { loadModularUI, removeModelByKey } from "../redux/_modularui/actions";
6
+ import {
7
+ loadModularUI,
8
+ removeModelByKey,
9
+ } from "../redux/_modularui/ModularUIActions";
7
10
 
8
11
  import useDeepCompareEffect from "./useDeepCompareEffect";
9
12
 
@@ -27,7 +27,7 @@ export const useModularUIBasic = <T: ModularUIModel>(
27
27
  throw new IllegalArgumentException("Missing href");
28
28
  }
29
29
 
30
- const useModularUIOptions = {};
30
+ const useModularUIOptions = { targetModel: undefined, isReload: false };
31
31
  if (options.targetModel) {
32
32
  useModularUIOptions.targetModel = options.targetModel;
33
33
  }
@@ -2,7 +2,13 @@
2
2
  import { useDispatch, useSelector } from "react-redux";
3
3
  import type { Location, LocationShape } from "react-router";
4
4
 
5
- import { push, replace, go, goBack, goForward } from "../redux/_router/actions";
5
+ import {
6
+ push,
7
+ replace,
8
+ go,
9
+ goBack,
10
+ goForward,
11
+ } from "../redux/_router/RouterActions";
6
12
  import type {
7
13
  GoAction,
8
14
  GoBackAction,
@@ -63,7 +63,7 @@ class AttributeCollection extends ResourceCollection<AttributeType> {
63
63
 
64
64
  /**
65
65
  */
66
- processLayoutHintRules() {
66
+ processLayoutHintRules(): void {
67
67
  this.all.forEach((attribute) => {
68
68
  attribute.processLayoutHintRules(this);
69
69
  });
@@ -157,14 +157,14 @@ class AttributeCollection extends ResourceCollection<AttributeType> {
157
157
  /**
158
158
  * Replace an attribute instance in the collection with a new attribute instance
159
159
  */
160
- replace(oldAttribute: AttributeType, newAttribute: AttributeType) {
160
+ replace(oldAttribute: AttributeType, newAttribute: AttributeType): void {
161
161
  this.replaceByKey(oldAttribute.key, newAttribute);
162
162
  }
163
163
 
164
164
  /**
165
165
  * Replace an attribute by the key of the attribute
166
166
  */
167
- replaceByKey(key: string, newAttribute: AttributeType) {
167
+ replaceByKey(key: string, newAttribute: AttributeType): void {
168
168
  this.forEach((attribute, index) => {
169
169
  if (attribute.key === key) {
170
170
  this.collection[index] = newAttribute;
@@ -176,7 +176,7 @@ class AttributeCollection extends ResourceCollection<AttributeType> {
176
176
  * Set reference date by replacing an old attribute with a new attribute with a reference Date
177
177
  * Date is a string in ISO format yyyy-MM-dd
178
178
  */
179
- setReferenceDate(date: string) {
179
+ setReferenceDate(date: string): void {
180
180
  this.forEach((attribute) => {
181
181
  const newAttribute = attribute.clone();
182
182
 
@@ -194,7 +194,7 @@ class AttributeCollection extends ResourceCollection<AttributeType> {
194
194
 
195
195
  /**
196
196
  */
197
- addServerError(error: FormErrorAnchor) {
197
+ addServerError(error: FormErrorAnchor): void {
198
198
  const elementid = error?.anchor?.elementid;
199
199
 
200
200
  if (elementid) {
@@ -244,7 +244,9 @@ class AttributeCollection extends ResourceCollection<AttributeType> {
244
244
 
245
245
  /**
246
246
  */
247
- indicateContentConfiguration(contentConfiguration: ContentConfiguration) {
247
+ indicateContentConfiguration(
248
+ contentConfiguration: ContentConfiguration
249
+ ): void {
248
250
  if (contentConfiguration) {
249
251
  this.all.forEach((attribute) => {
250
252
  attribute.indicateContentConfiguration(contentConfiguration);
@@ -144,7 +144,7 @@ export default class AttributeModel
144
144
 
145
145
  /**
146
146
  */
147
- setChildModels(models: Array<ModularUIModel>) {
147
+ setChildModels(models: Array<ModularUIModel>): void {
148
148
  const conceptHref = this.conceptLink?.href;
149
149
  if (conceptHref) {
150
150
  this.concept = models.find((model) =>
@@ -214,7 +214,9 @@ export default class AttributeModel
214
214
 
215
215
  /**
216
216
  */
217
- indicateContentConfiguration(contentConfiguration: ContentConfiguration) {
217
+ indicateContentConfiguration(
218
+ contentConfiguration: ContentConfiguration
219
+ ): void {
218
220
  if (contentConfiguration) {
219
221
  const hasQuestionConfig = contentConfiguration.questions?.hasConfig();
220
222
 
@@ -634,7 +636,7 @@ export default class AttributeModel
634
636
  /**
635
637
  * Used to programmatically overwrite the setting USE_CLIENTSIDE_VALIDATION
636
638
  */
637
- setUseClientsideValidation(enabled: boolean) {
639
+ setUseClientsideValidation(enabled: boolean): void {
638
640
  this._useClientsideValidation = enabled;
639
641
  }
640
642
 
@@ -701,14 +703,14 @@ export default class AttributeModel
701
703
  /**
702
704
  * Reset static error messages on attribute
703
705
  */
704
- resetErrors() {
706
+ resetErrors(): void {
705
707
  this._errorCollection = new ErrorCollection("attribute");
706
708
  }
707
709
 
708
710
  /**
709
711
  * Registers an error that was received from a server response
710
712
  */
711
- addServerError(error: FormErrorAnchor) {
713
+ addServerError(error: FormErrorAnchor): void {
712
714
  this._errorCollection.addServerError(
713
715
  error.id,
714
716
  error.message,
@@ -719,7 +721,7 @@ export default class AttributeModel
719
721
 
720
722
  /**
721
723
  */
722
- removeServerError(id: string) {
724
+ removeServerError(id: string): void {
723
725
  this._errorCollection.removeServerError(id);
724
726
  }
725
727
 
@@ -738,13 +740,13 @@ export default class AttributeModel
738
740
  /**
739
741
  * Registers a missing error that was received from the server
740
742
  */
741
- addMissingError() {
743
+ addMissingError(): void {
742
744
  this._errorCollection.addServerError("Constraint.Missing");
743
745
  }
744
746
 
745
747
  /**
746
748
  */
747
- removeMissingError() {
749
+ removeMissingError(): void {
748
750
  this.removeServerError("Constraint.Missing");
749
751
  }
750
752
 
@@ -771,7 +773,7 @@ export default class AttributeModel
771
773
  return {};
772
774
  }
773
775
 
774
- const params = {};
776
+ const params: { [name: string]: string | number } = {};
775
777
 
776
778
  Object.keys(parameters).forEach((paramKey: string) => {
777
779
  const paramValue = parameters[paramKey];
@@ -793,7 +795,7 @@ export default class AttributeModel
793
795
 
794
796
  /**
795
797
  */
796
- updateValidations(errors: Array<Object>) {
798
+ updateValidations(errors: Array<Object>): void {
797
799
  if (
798
800
  errors.some((error) => error.id === "Constraint.Mandatory") ||
799
801
  this.layouthint.has(MANDATORY)
@@ -831,7 +833,7 @@ export default class AttributeModel
831
833
  /**
832
834
  * Set last modification to current timestamp
833
835
  */
834
- updateLastModification() {
836
+ updateLastModification(): void {
835
837
  this._lastModification = Date.now();
836
838
  }
837
839
 
@@ -847,7 +849,7 @@ export default class AttributeModel
847
849
  *
848
850
  * @abstract
849
851
  */
850
- reset() {
852
+ reset(): void {
851
853
  throw new UnsupportedOperationException(
852
854
  `Reset method not implemented for ${this.type}`
853
855
  );
@@ -857,7 +859,7 @@ export default class AttributeModel
857
859
  * Merge old attribute with the attribute from the server.
858
860
  * Readonly attributes always need to show the value from the server
859
861
  */
860
- mergeAttribute(oldAttribute: AttributeType) {
862
+ mergeAttribute(oldAttribute: AttributeType): void {
861
863
  this.concept = oldAttribute.concept;
862
864
 
863
865
  if (
@@ -916,13 +918,13 @@ export default class AttributeModel
916
918
  /**
917
919
  * Explicitly toggle visibility of this attribute
918
920
  */
919
- show() {
921
+ show(): void {
920
922
  this.isHidden = false;
921
923
  }
922
924
 
923
925
  /**
924
926
  */
925
- hide() {
927
+ hide(): void {
926
928
  this.isHidden = true;
927
929
  }
928
930
 
@@ -956,7 +958,7 @@ export default class AttributeModel
956
958
 
957
959
  /**
958
960
  */
959
- processLayoutHintRules(attributes: AttributeCollection) {
961
+ processLayoutHintRules(attributes: AttributeCollection): void {
960
962
  if (this._layoutHintRules) {
961
963
  this.layoutHintRules.process(this, attributes);
962
964
  }
@@ -171,7 +171,7 @@ class CompositeAttributeChildCollection extends ResourceCollection<AttributeType
171
171
  );
172
172
  }
173
173
 
174
- const children = {};
174
+ const children: { [string]: any } = {};
175
175
  this.collection
176
176
  .filter((child) => child.initvalue !== null)
177
177
  .forEach((child) => {
@@ -79,9 +79,13 @@ export default class NumberAttributeModel extends AttributeModel {
79
79
  * Gets the maximum digits based on the format
80
80
  */
81
81
  get maxDigits(): number {
82
- return this.format && this.format.includes(".")
83
- ? this.format.split(".")[1].length
84
- : 0;
82
+ const format = this.format;
83
+
84
+ if (format != null && format.includes(".")) {
85
+ return format.split(".")[1].length;
86
+ }
87
+
88
+ return 0;
85
89
  }
86
90
 
87
91
  /**
@@ -49,7 +49,7 @@ const getChildrenKeys = (children: Array<Object>): Array<Object> => {
49
49
  /**
50
50
  * @private
51
51
  */
52
- const getAttributeModel = (contributions): ?Class<AttributeType> => {
52
+ const getAttributeModel = (contributions: Object): ?Class<AttributeType> => {
53
53
  const ATTRIBUTE_MODELS = [
54
54
  ChoiceAttributeModel,
55
55
  BooleanAttributeModel,
@@ -65,7 +65,7 @@ class BaseLayoutHintRule implements ILayoutHintRule {
65
65
  * use this to enhance the applicable attribute or the attribute collection
66
66
  * @abstract
67
67
  */
68
- process(attribute: AttributeModel, attributes: AttributeCollection) {
68
+ process(attribute: AttributeModel, attributes: AttributeCollection): void {
69
69
  throw new IllegalStateException(
70
70
  `Missing process implementation on layout hint rule`
71
71
  );
@@ -218,7 +218,7 @@ class DependentAttribute extends BaseLayoutHintRule {
218
218
 
219
219
  /**
220
220
  */
221
- process(attribute: AttributeModel, attributes: AttributeCollection) {
221
+ process(attribute: AttributeModel, attributes: AttributeCollection): void {
222
222
  const controlAttribute = this.getControlAttribute(attributes);
223
223
  if (!controlAttribute) {
224
224
  return;
@@ -187,7 +187,7 @@ class ResourceModel extends BaseModel implements IModelWithChildModels {
187
187
  * @abstract
188
188
  * @example <caption>Put all models of instance List and GroupingPanel into the panels property</caption>
189
189
  */
190
- setChildModels(models: Array<ModularUIModel>) {
190
+ setChildModels(models: Array<ModularUIModel>): void {
191
191
  if (!models) {
192
192
  throw new IllegalArgumentException("No models send to setChildModels");
193
193
  }
@@ -16,7 +16,10 @@ import type LinkModel from "../links/LinkModel";
16
16
  /**
17
17
  * Get content items recursively
18
18
  */
19
- const getItems = (items, entryDate): Array<ContentLinkModel> =>
19
+ const getItems = (
20
+ items: Array<Object>,
21
+ entryDate: ISO_DATE | null
22
+ ): Array<ContentLinkModel> =>
20
23
  items.map((item) => {
21
24
  const link = new ContentLinkModel(
22
25
  {
@@ -144,7 +144,7 @@ export default class FilterCollection extends BaseCollection<FilterType> {
144
144
  /**
145
145
  * Update Filter by input name and value
146
146
  */
147
- update(attribute: AttributeType, value: string) {
147
+ update(attribute: AttributeType, value: string): void {
148
148
  const filterToUpdate = attribute.parentKey
149
149
  ? this.getFilterByAttributeKey(attribute.parentKey)
150
150
  : this.getFilterByAttributeKey(attribute.key);
@@ -291,7 +291,7 @@ class FormModel extends ResourceModel {
291
291
 
292
292
  /**
293
293
  */
294
- addFormObject(formObjectModel: FormObjectModel) {
294
+ addFormObject(formObjectModel: FormObjectModel): void {
295
295
  if (!formObjectModel) {
296
296
  throw new IllegalArgumentException("Missing form object to add");
297
297
  }
@@ -318,7 +318,7 @@ class FormModel extends ResourceModel {
318
318
 
319
319
  /**
320
320
  */
321
- removeFormObject(formObjectModel: ?FormObjectModel) {
321
+ removeFormObject(formObjectModel: ?FormObjectModel): void {
322
322
  if (!formObjectModel) {
323
323
  throw new IllegalArgumentException("Missing form object to remove");
324
324
  }
@@ -67,7 +67,7 @@ class LinkModel extends BaseModel {
67
67
  */
68
68
  handleInitialFilters(href: Href) {
69
69
  if (this.layouthint.has(INITIAL_FILTER)) {
70
- const filters = {};
70
+ const filters: { [string]: Array<string> } = {};
71
71
  this.layouthint
72
72
  .filter((hint) => hint.startsWith(INITIAL_FILTER))
73
73
  .forEach((hint) => {
@@ -79,7 +79,9 @@ class LinkModel extends BaseModel {
79
79
  filters[p.name] = [];
80
80
  }
81
81
 
82
- filters[p.name].push(p.value);
82
+ if (p.value != null) {
83
+ filters[p.name].push(p.value);
84
+ }
83
85
  }
84
86
  });
85
87
 
@@ -3,7 +3,7 @@
3
3
  * Flatten JSON structure into a one dimensional array
4
4
  * @private
5
5
  */
6
- const createLink = (link, linkKey) => {
6
+ const createLink = (link: Object, linkKey: string) => {
7
7
  const newLink = link;
8
8
  newLink.group = linkKey;
9
9
  return newLink;
@@ -381,7 +381,7 @@ export default class ListModel extends ResourceModel {
381
381
  /**
382
382
  */
383
383
  getSortingLabels(): { [string]: string } {
384
- const sortingLabels = {};
384
+ const sortingLabels: { [string]: string } = {};
385
385
 
386
386
  if (this.contributions.results) {
387
387
  const { results } = this.contributions;
@@ -55,7 +55,7 @@ class Parameter {
55
55
  const namePart = parameter.substr(0, parameter.indexOf("="));
56
56
  const value = parameter.substr(parameter.indexOf("=") + 1);
57
57
 
58
- let prefix = void 0;
58
+ let prefix;
59
59
  let name = namePart;
60
60
  if (namePart.includes(PARAMETER_SEPARATOR)) {
61
61
  prefix = namePart.substr(0, namePart.indexOf("~"));
@@ -116,25 +116,25 @@ export type FormErrorAnchor = {
116
116
  },
117
117
  };
118
118
 
119
- export type labelsJSON = {|
119
+ export type labelsJSON = {
120
120
  _id: string,
121
121
  label: string,
122
122
  value: string,
123
- |};
123
+ };
124
124
 
125
- export type propertyJSON = {|
125
+ export type propertyJSON = {
126
126
  _id: string,
127
127
  type: string,
128
128
  mandatory: string,
129
129
  label: string,
130
130
  value: string,
131
- |};
131
+ };
132
132
 
133
- export type textfragmentJSON = {|
133
+ export type textfragmentJSON = {
134
134
  label: string,
135
135
  text: string,
136
136
  type: string,
137
- |};
137
+ };
138
138
 
139
139
  export interface IConstraintModel {
140
140
  +id: string;
@@ -183,7 +183,7 @@ class ModularUIRequest {
183
183
 
184
184
  /**
185
185
  */
186
- processContributionsService(contributionsData: Object) {
186
+ processContributionsService(contributionsData: Object): void {
187
187
  if (!isPlainObject(contributionsData)) {
188
188
  throw new IllegalArgumentException(
189
189
  "Missing contributions data or contributions is not JSON"
@@ -206,14 +206,14 @@ class ModularUIRequest {
206
206
 
207
207
  /**
208
208
  */
209
- handleContributionsError(error: Object) {
209
+ handleContributionsError(error: Object): void {
210
210
  const errorMessage = error.properties?.message ?? "Error in contribution";
211
211
  throw new ModularUIError(errorMessage, error, this.contributionsHref);
212
212
  }
213
213
 
214
214
  /**
215
215
  */
216
- handleDataError(error: Object) {
216
+ handleDataError(error: Object): void {
217
217
  if (error.properties) {
218
218
  const errorMessage = error.properties?.message ?? "Error in data";
219
219
  throw new ModularUIError(errorMessage, error, this.href.path.toString());
@@ -224,7 +224,7 @@ class ModularUIRequest {
224
224
 
225
225
  /**
226
226
  */
227
- handleData(key: string, data: Object) {
227
+ handleData(key: string, data: Object): void {
228
228
  this.response.key = key;
229
229
  this.response.data = data;
230
230
 
@@ -243,7 +243,7 @@ class ModularUIRequest {
243
243
 
244
244
  /**
245
245
  */
246
- processDataService(data: Object) {
246
+ processDataService(data: Object): void {
247
247
  if (!isPlainObject(data)) {
248
248
  throw new IllegalArgumentException("Missing data or data is not JSON");
249
249
  }
@@ -431,7 +431,7 @@ class ModularUIRequest {
431
431
  );
432
432
  }
433
433
 
434
- const newDataLinks = {};
434
+ const newDataLinks: { [string]: any } = {};
435
435
  for (const dataLinkKey in dataLinks) {
436
436
  if (!hiddenLinks.includes(dataLinkKey)) {
437
437
  newDataLinks[dataLinkKey] = dataLinks[dataLinkKey];