@axelor/aos-mobile-core 8.0.7 → 8.1.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 (393) hide show
  1. package/README.md +3 -22
  2. package/lib/api/login-api.js +3 -3
  3. package/lib/api/login-api.js.map +1 -1
  4. package/lib/api/metafile-api.js +1 -1
  5. package/lib/api/metafile-api.js.map +1 -1
  6. package/lib/apiProviders/Standard/ObjectFieldsProvider.d.ts +1 -1
  7. package/lib/apiProviders/Standard/requests.helper.d.ts +1 -0
  8. package/lib/apiProviders/Standard/requests.helper.js +3 -0
  9. package/lib/apiProviders/Standard/requests.helper.js.map +1 -1
  10. package/lib/apiProviders/utils.js +14 -8
  11. package/lib/apiProviders/utils.js.map +1 -1
  12. package/lib/app/Application.d.ts +3 -2
  13. package/lib/app/Application.js +7 -3
  14. package/lib/app/Application.js.map +1 -1
  15. package/lib/app/ContextedApplication.d.ts +2 -3
  16. package/lib/app/ContextedApplication.js +9 -4
  17. package/lib/app/ContextedApplication.js.map +1 -1
  18. package/lib/app/ContextsProvider.d.ts +1 -3
  19. package/lib/app/ContextsProvider.js +26 -15
  20. package/lib/app/ContextsProvider.js.map +1 -1
  21. package/lib/app/RootNavigator.d.ts +3 -4
  22. package/lib/app/RootNavigator.js +4 -5
  23. package/lib/app/RootNavigator.js.map +1 -1
  24. package/lib/app/context.helper.d.ts +3 -3
  25. package/lib/app/context.helper.js +50 -0
  26. package/lib/app/context.helper.js.map +1 -1
  27. package/lib/app/index.d.ts +1 -1
  28. package/lib/app/index.js +1 -0
  29. package/lib/app/index.js.map +1 -1
  30. package/lib/app/modules/ModuleProvider.d.ts +18 -0
  31. package/lib/app/modules/ModuleProvider.js +73 -0
  32. package/lib/app/modules/ModuleProvider.js.map +1 -0
  33. package/lib/app/modules/index.d.ts +2 -0
  34. package/lib/app/modules/index.js +20 -0
  35. package/lib/app/modules/index.js.map +1 -0
  36. package/lib/app/{Module.d.ts → modules/types.d.ts} +5 -2
  37. package/lib/app/{Module.js → modules/types.js} +1 -1
  38. package/lib/app/modules/types.js.map +1 -0
  39. package/lib/auth/api/config-api.d.ts +1 -0
  40. package/lib/auth/api/config-api.js +26 -0
  41. package/lib/auth/api/config-api.js.map +1 -0
  42. package/lib/auth/components/molecules/DashboardsCard/DashboardsCard.d.ts +5 -0
  43. package/lib/auth/components/molecules/DashboardsCard/DashboardsCard.js +49 -0
  44. package/lib/auth/components/molecules/DashboardsCard/DashboardsCard.js.map +1 -0
  45. package/lib/auth/components/molecules/NavigationToolsButton/NavigationToolsButton.d.ts +3 -0
  46. package/lib/auth/components/molecules/NavigationToolsButton/NavigationToolsButton.js +60 -0
  47. package/lib/auth/components/molecules/NavigationToolsButton/NavigationToolsButton.js.map +1 -0
  48. package/lib/auth/components/molecules/ShortcutsCard/ShortcutsCard.d.ts +7 -0
  49. package/lib/auth/components/molecules/ShortcutsCard/ShortcutsCard.js +71 -0
  50. package/lib/auth/components/molecules/ShortcutsCard/ShortcutsCard.js.map +1 -0
  51. package/lib/auth/components/molecules/TranslationsButton/TranslationsButton.d.ts +2 -1
  52. package/lib/auth/components/molecules/TranslationsButton/TranslationsButton.js +5 -3
  53. package/lib/auth/components/molecules/TranslationsButton/TranslationsButton.js.map +1 -1
  54. package/lib/auth/components/molecules/UserCard/UserCard.d.ts +6 -0
  55. package/lib/auth/components/molecules/UserCard/UserCard.js +105 -0
  56. package/lib/auth/components/molecules/UserCard/UserCard.js.map +1 -0
  57. package/lib/auth/components/molecules/index.d.ts +4 -0
  58. package/lib/auth/components/molecules/index.js +4 -0
  59. package/lib/auth/components/molecules/index.js.map +1 -1
  60. package/lib/auth/features/companySlice.d.ts +1 -10
  61. package/lib/auth/features/configSlice.d.ts +3 -11
  62. package/lib/auth/features/configSlice.js +20 -0
  63. package/lib/auth/features/configSlice.js.map +1 -1
  64. package/lib/auth/features/localizationSlice.d.ts +1 -10
  65. package/lib/auth/features/userSlice.d.ts +3 -21
  66. package/lib/auth/i18n/en.json +3 -1
  67. package/lib/auth/i18n/fr.json +3 -1
  68. package/lib/auth/index.d.ts +1 -1
  69. package/lib/auth/models/objectFields.js +4 -1
  70. package/lib/auth/models/objectFields.js.map +1 -1
  71. package/lib/auth/screens/SettingsScreen.d.ts +2 -1
  72. package/lib/auth/screens/SettingsScreen.js +45 -13
  73. package/lib/auth/screens/SettingsScreen.js.map +1 -1
  74. package/lib/auth/screens/UserScreen.d.ts +2 -1
  75. package/lib/auth/screens/UserScreen.js +18 -75
  76. package/lib/auth/screens/UserScreen.js.map +1 -1
  77. package/lib/components/external/Camera/Camera.d.ts +2 -1
  78. package/lib/components/external/Camera/Camera.js +49 -64
  79. package/lib/components/external/Camera/Camera.js.map +1 -1
  80. package/lib/components/external/Camera/CaptureButton.d.ts +1 -1
  81. package/lib/components/external/Camera/CaptureButton.js.map +1 -1
  82. package/lib/components/external/CodeHighlighter/CodeHighlighter.d.ts +2 -1
  83. package/lib/components/external/PlanningView/PlanningView.d.ts +1 -1
  84. package/lib/components/external/Stopwatch/Stopwatch.d.ts +2 -1
  85. package/lib/components/external/Timer/Timer.d.ts +2 -2
  86. package/lib/components/external/Timer/Timer.js +3 -2
  87. package/lib/components/external/Timer/Timer.js.map +1 -1
  88. package/lib/components/external/Toast/Toast.d.ts +2 -1
  89. package/lib/components/external/WebView/WebView.d.ts +9 -0
  90. package/lib/components/external/WebView/WebView.js +52 -0
  91. package/lib/components/external/WebView/WebView.js.map +1 -0
  92. package/lib/components/external/index.d.ts +1 -1
  93. package/lib/components/external/index.js +1 -1
  94. package/lib/components/external/index.js.map +1 -1
  95. package/lib/components/molecules/CameraButton/CameraButton.d.ts +2 -1
  96. package/lib/components/molecules/DateDisplay/DateDisplay.d.ts +2 -1
  97. package/lib/components/molecules/DatePicker/DatePicker.d.ts +2 -1
  98. package/lib/components/molecules/FocusScreen/FocusScreen.d.ts +2 -1
  99. package/lib/components/molecules/HeaderBand/HeaderBand.d.ts +2 -1
  100. package/lib/components/molecules/HeaderBand/HeaderBand.js +31 -8
  101. package/lib/components/molecules/HeaderBand/HeaderBand.js.map +1 -1
  102. package/lib/components/molecules/HeaderOptionsMenuItem/HeaderOptionMenuItem.d.ts +2 -2
  103. package/lib/components/molecules/InputBarCodeCard/InputBarCodeCard.d.ts +2 -1
  104. package/lib/components/molecules/MailMessageReadIcon/MailMessageReadIcon.d.ts +2 -1
  105. package/lib/components/molecules/PeriodDisplay/PeriodDisplay.d.ts +2 -1
  106. package/lib/components/molecules/TrackItem/TrackItem.d.ts +2 -1
  107. package/lib/components/molecules/UploadFileInput/UploadFileInput.d.ts +2 -1
  108. package/lib/components/organisms/AOSImage/AOSImage.d.ts +2 -1
  109. package/lib/components/organisms/AOSImageBubble/AOSImageBubble.d.ts +2 -1
  110. package/lib/components/organisms/AnomalyBubble/AnomalyBubble.d.ts +2 -1
  111. package/lib/components/organisms/AnomalyList/AnomalyList.d.ts +2 -1
  112. package/lib/components/organisms/DateInput/DateInput.d.ts +2 -1
  113. package/lib/components/organisms/HeaderBandList/HeaderBandList.d.ts +2 -1
  114. package/lib/components/organisms/HeaderOptionsMenu/HeaderOptionsMenu.d.ts +2 -1
  115. package/lib/components/organisms/MailMessageCard/MailMessageCard.d.ts +2 -1
  116. package/lib/components/organisms/MailMessageCommentCard/MailMessageCommentCard.d.ts +2 -1
  117. package/lib/components/organisms/MailMessageNotificationCard/MailMessageNotificationCard.d.ts +2 -1
  118. package/lib/components/organisms/ScannerAutocompleteSearch/ScannerAutocompleteSearch.d.ts +2 -1
  119. package/lib/components/organisms/SignatureInput/PictureIcon.d.ts +9 -0
  120. package/lib/components/organisms/SignatureInput/PictureIcon.js +35 -0
  121. package/lib/components/organisms/SignatureInput/PictureIcon.js.map +1 -0
  122. package/lib/components/organisms/SignatureInput/SignatureInput.d.ts +16 -0
  123. package/lib/components/organisms/SignatureInput/SignatureInput.js +197 -0
  124. package/lib/components/organisms/SignatureInput/SignatureInput.js.map +1 -0
  125. package/lib/components/organisms/index.d.ts +1 -0
  126. package/lib/components/organisms/index.js +1 -0
  127. package/lib/components/organisms/index.js.map +1 -1
  128. package/lib/components/pages/CustomFieldForm/CustomFieldForm.d.ts +2 -1
  129. package/lib/components/pages/CustomFieldForm/CustomFieldForm.js +7 -5
  130. package/lib/components/pages/CustomFieldForm/CustomFieldForm.js.map +1 -1
  131. package/lib/components/pages/FormView/Alerts/ConfirmationPopup.d.ts +7 -0
  132. package/lib/components/pages/FormView/Alerts/ConfirmationPopup.js +45 -0
  133. package/lib/components/pages/FormView/Alerts/ConfirmationPopup.js.map +1 -0
  134. package/lib/components/pages/FormView/Alerts/ConstraintsValidatorPopup.d.ts +2 -1
  135. package/lib/components/pages/FormView/Alerts/index.d.ts +1 -0
  136. package/lib/components/pages/FormView/Alerts/index.js +1 -0
  137. package/lib/components/pages/FormView/Alerts/index.js.map +1 -1
  138. package/lib/components/pages/FormView/Buttons/FloatingTools.d.ts +14 -0
  139. package/lib/components/pages/FormView/Buttons/FloatingTools.js +103 -0
  140. package/lib/components/pages/FormView/Buttons/FloatingTools.js.map +1 -0
  141. package/lib/components/pages/FormView/Buttons/index.d.ts +1 -0
  142. package/lib/components/pages/FormView/Buttons/index.js +19 -0
  143. package/lib/components/pages/FormView/Buttons/index.js.map +1 -0
  144. package/lib/components/pages/FormView/Components/Field.d.ts +3 -1
  145. package/lib/components/pages/FormView/Components/Field.js +14 -6
  146. package/lib/components/pages/FormView/Components/Field.js.map +1 -1
  147. package/lib/components/pages/FormView/Components/Panel.d.ts +2 -2
  148. package/lib/components/pages/FormView/Custom/CustomButton.d.ts +2 -1
  149. package/lib/components/pages/FormView/Custom/CustomPasswordInput.d.ts +2 -1
  150. package/lib/components/pages/FormView/Custom/CustomPicker.d.ts +2 -1
  151. package/lib/components/pages/FormView/Custom/CustomSearchBar.d.ts +2 -1
  152. package/lib/components/pages/FormView/FormView.d.ts +6 -2
  153. package/lib/components/pages/FormView/FormView.js +96 -119
  154. package/lib/components/pages/FormView/FormView.js.map +1 -1
  155. package/lib/components/templates/AttachedFilesView/AttachedFilesView.d.ts +5 -2
  156. package/lib/components/templates/AttachedFilesView/AttachedFilesView.js +2 -2
  157. package/lib/components/templates/AttachedFilesView/AttachedFilesView.js.map +1 -1
  158. package/lib/components/templates/MailMessageView/MailMessageView.d.ts +5 -2
  159. package/lib/components/templates/MailMessageView/MailMessageView.js +2 -2
  160. package/lib/components/templates/MailMessageView/MailMessageView.js.map +1 -1
  161. package/lib/components/templates/PeriodInput/PeriodInput.d.ts +15 -0
  162. package/lib/components/templates/PeriodInput/PeriodInput.js +85 -0
  163. package/lib/components/templates/PeriodInput/PeriodInput.js.map +1 -0
  164. package/lib/components/templates/PopupApplicationInformation/PopupApplicationInformation.d.ts +2 -1
  165. package/lib/components/templates/PopupMinimalRequiredVersion/PopupMinimalRequiredVersion.d.ts +2 -1
  166. package/lib/components/templates/SearchListView/SearchListView.d.ts +27 -0
  167. package/lib/components/templates/SearchListView/SearchListView.js +81 -0
  168. package/lib/components/templates/SearchListView/SearchListView.js.map +1 -0
  169. package/lib/components/templates/SearchTreeView/SearchTreeView.d.ts +38 -0
  170. package/lib/components/templates/SearchTreeView/SearchTreeView.js +110 -0
  171. package/lib/components/templates/SearchTreeView/SearchTreeView.js.map +1 -0
  172. package/lib/components/templates/SocialNetworkLinks/SocialNetworkLinks.d.ts +2 -1
  173. package/lib/components/templates/UserSearchBar/UserSearchBar.d.ts +2 -1
  174. package/lib/components/templates/index.d.ts +3 -0
  175. package/lib/components/templates/index.js +3 -0
  176. package/lib/components/templates/index.js.map +1 -1
  177. package/lib/dashboards/api.helpers.d.ts +1 -0
  178. package/lib/dashboards/api.helpers.js +5 -0
  179. package/lib/dashboards/api.helpers.js.map +1 -1
  180. package/lib/dashboards/component/AOPChart/AOPChart.d.ts +6 -0
  181. package/lib/dashboards/component/AOPChart/AOPChart.js +67 -0
  182. package/lib/dashboards/component/AOPChart/AOPChart.js.map +1 -0
  183. package/lib/dashboards/component/AOPChart/api.helpers.d.ts +16 -0
  184. package/lib/dashboards/component/AOPChart/api.helpers.js +59 -0
  185. package/lib/dashboards/component/AOPChart/api.helpers.js.map +1 -0
  186. package/lib/dashboards/component/AOPChart/format.helpers.d.ts +11 -0
  187. package/lib/dashboards/component/AOPChart/format.helpers.js +47 -0
  188. package/lib/dashboards/component/AOPChart/format.helpers.js.map +1 -0
  189. package/lib/dashboards/component/RefreshChart/RefreshChart.d.ts +8 -0
  190. package/lib/dashboards/component/RefreshChart/RefreshChart.js +83 -0
  191. package/lib/dashboards/component/RefreshChart/RefreshChart.js.map +1 -0
  192. package/lib/dashboards/component/index.d.ts +2 -0
  193. package/lib/dashboards/component/index.js +20 -0
  194. package/lib/dashboards/component/index.js.map +1 -0
  195. package/lib/dashboards/index.d.ts +2 -0
  196. package/lib/dashboards/index.js +20 -0
  197. package/lib/dashboards/index.js.map +1 -0
  198. package/lib/dashboards/menu.helpers.d.ts +1 -24
  199. package/lib/dashboards/menu.helpers.js +0 -9
  200. package/lib/dashboards/menu.helpers.js.map +1 -1
  201. package/lib/dashboards/view/DashboardScreen.d.ts +7 -3
  202. package/lib/dashboards/view/DashboardScreen.js +4 -65
  203. package/lib/dashboards/view/DashboardScreen.js.map +1 -1
  204. package/lib/dashboards/view/DashboardView.d.ts +10 -0
  205. package/lib/dashboards/view/DashboardView.js +87 -0
  206. package/lib/dashboards/view/DashboardView.js.map +1 -0
  207. package/lib/dashboards/view/index.d.ts +1 -0
  208. package/lib/dashboards/view/index.js +1 -0
  209. package/lib/dashboards/view/index.js.map +1 -1
  210. package/lib/features/appConfigSlice.d.ts +1 -10
  211. package/lib/features/attachedFilesSlice.d.ts +3 -30
  212. package/lib/features/authSlice.d.ts +39 -34
  213. package/lib/features/authSlice.js +7 -2
  214. package/lib/features/authSlice.js.map +1 -1
  215. package/lib/features/formSlice.d.ts +5 -31
  216. package/lib/features/formSlice.js +10 -1
  217. package/lib/features/formSlice.js.map +1 -1
  218. package/lib/features/index.d.ts +2 -0
  219. package/lib/features/index.js +2 -0
  220. package/lib/features/index.js.map +1 -1
  221. package/lib/features/mailMessageSlice.d.ts +8 -80
  222. package/lib/features/metaJsonFieldSlice.d.ts +5 -30
  223. package/lib/features/metaJsonFieldSlice.js +14 -1
  224. package/lib/features/metaJsonFieldSlice.js.map +1 -1
  225. package/lib/features/metaModuleSlice.d.ts +1 -10
  226. package/lib/features/metafileSlice.d.ts +1 -10
  227. package/lib/features/mobileDashboardSlice.d.ts +1 -10
  228. package/lib/features/mobileWebViewSlice.d.ts +4 -0
  229. package/lib/features/mobileWebViewSlice.js +43 -0
  230. package/lib/features/mobileWebViewSlice.js.map +1 -0
  231. package/lib/features/onlineSlice.d.ts +3 -3
  232. package/lib/features/permissionSlice.d.ts +6 -0
  233. package/lib/features/permissionSlice.js +59 -0
  234. package/lib/features/permissionSlice.js.map +1 -0
  235. package/lib/features/userSlice.d.ts +1 -10
  236. package/lib/forms/action.helpers.d.ts +3 -0
  237. package/lib/forms/action.helpers.js +106 -0
  238. package/lib/forms/action.helpers.js.map +1 -0
  239. package/lib/forms/api.helpers.d.ts +4 -0
  240. package/lib/forms/api.helpers.js +13 -0
  241. package/lib/forms/api.helpers.js.map +1 -1
  242. package/lib/forms/display.helpers.d.ts +1 -2
  243. package/lib/forms/display.helpers.js +2 -19
  244. package/lib/forms/display.helpers.js.map +1 -1
  245. package/lib/forms/index.d.ts +1 -0
  246. package/lib/forms/index.js +1 -0
  247. package/lib/forms/index.js.map +1 -1
  248. package/lib/forms/studio/api.helpers.d.ts +3 -0
  249. package/lib/forms/studio/api.helpers.js +26 -0
  250. package/lib/forms/studio/api.helpers.js.map +1 -1
  251. package/lib/forms/studio/display.helpers.d.ts +2 -1
  252. package/lib/forms/studio/display.helpers.js +10 -4
  253. package/lib/forms/studio/display.helpers.js.map +1 -1
  254. package/lib/forms/studio/index.d.ts +1 -0
  255. package/lib/forms/studio/index.js +1 -0
  256. package/lib/forms/studio/index.js.map +1 -1
  257. package/lib/forms/studio/permission.helpers.d.ts +3 -0
  258. package/lib/forms/studio/permission.helpers.js +59 -0
  259. package/lib/forms/studio/permission.helpers.js.map +1 -0
  260. package/lib/forms/types.d.ts +9 -5
  261. package/lib/header/HeaderBandContext.d.ts +2 -1
  262. package/lib/i18n/component/Translator.d.ts +19 -3
  263. package/lib/i18n/translations/en.json +17 -2
  264. package/lib/i18n/translations/fr.json +17 -2
  265. package/lib/index.d.ts +3 -0
  266. package/lib/index.js +3 -0
  267. package/lib/index.js.map +1 -1
  268. package/lib/models/objectFields.js +17 -0
  269. package/lib/models/objectFields.js.map +1 -1
  270. package/lib/navigator/NavigationInformationsProvider.d.ts +33 -0
  271. package/lib/navigator/NavigationInformationsProvider.js +81 -0
  272. package/lib/navigator/NavigationInformationsProvider.js.map +1 -0
  273. package/lib/navigator/Navigator.d.ts +2 -4
  274. package/lib/navigator/Navigator.js +32 -11
  275. package/lib/navigator/Navigator.js.map +1 -1
  276. package/lib/navigator/drawer/AuthMenuIconButton.d.ts +2 -1
  277. package/lib/navigator/drawer/BackIcon.d.ts +2 -1
  278. package/lib/navigator/drawer/DrawerContent.d.ts +3 -3
  279. package/lib/navigator/drawer/DrawerContent.js +3 -2
  280. package/lib/navigator/drawer/DrawerContent.js.map +1 -1
  281. package/lib/navigator/drawer/DrawerToggleButton.d.ts +2 -1
  282. package/lib/navigator/drawer/Header.d.ts +2 -1
  283. package/lib/navigator/drawer/Menu.d.ts +2 -1
  284. package/lib/navigator/drawer/MenuIconButton.d.ts +2 -1
  285. package/lib/navigator/drawer/MenuItem.d.ts +2 -1
  286. package/lib/navigator/drawer/MenuItemEntry.d.ts +2 -1
  287. package/lib/navigator/drawer/MenuSeparator.d.ts +2 -1
  288. package/lib/navigator/drawer/MenuTitle.d.ts +2 -1
  289. package/lib/navigator/drawer/SubMenuItem.d.ts +2 -1
  290. package/lib/navigator/drawer/SubMenuItemList.d.ts +2 -1
  291. package/lib/navigator/menu.helper.d.ts +4 -0
  292. package/lib/navigator/menu.helper.js +21 -0
  293. package/lib/navigator/menu.helper.js.map +1 -1
  294. package/lib/navigator/module.helper.d.ts +1 -2
  295. package/lib/navigator/module.helper.js.map +1 -1
  296. package/lib/permissions/api.helpers.d.ts +6 -0
  297. package/lib/permissions/api.helpers.js +64 -0
  298. package/lib/permissions/api.helpers.js.map +1 -0
  299. package/lib/permissions/format.helpers.d.ts +5 -0
  300. package/lib/permissions/format.helpers.js +81 -0
  301. package/lib/permissions/format.helpers.js.map +1 -0
  302. package/lib/permissions/hooks.d.ts +14 -0
  303. package/lib/permissions/hooks.js +97 -0
  304. package/lib/permissions/hooks.js.map +1 -0
  305. package/lib/permissions/index.d.ts +1 -0
  306. package/lib/permissions/index.js +19 -0
  307. package/lib/permissions/index.js.map +1 -0
  308. package/lib/permissions/type.helpers.d.ts +30 -0
  309. package/lib/permissions/type.helpers.js +34 -0
  310. package/lib/permissions/type.helpers.js.map +1 -0
  311. package/lib/redux/hooks.d.ts +2 -4
  312. package/lib/redux/hooks.js.map +1 -1
  313. package/lib/redux/store.d.ts +3 -1
  314. package/lib/screens/AttachedFilesScreen.d.ts +2 -1
  315. package/lib/screens/BarcodeDisplayScreen.d.ts +2 -1
  316. package/lib/screens/ErrorScreen.d.ts +2 -1
  317. package/lib/screens/JsonFieldScreen.d.ts +2 -1
  318. package/lib/screens/LoginScreen.d.ts +2 -1
  319. package/lib/screens/LoginScreen.js +1 -2
  320. package/lib/screens/LoginScreen.js.map +1 -1
  321. package/lib/screens/MailMessageScreen.d.ts +2 -1
  322. package/lib/screens/SessionManagementScreen.d.ts +2 -1
  323. package/lib/screens/SessionManagementScreen.js +2 -1
  324. package/lib/screens/SessionManagementScreen.js.map +1 -1
  325. package/lib/selections/SelectionProvider.d.ts +4 -0
  326. package/lib/selections/SelectionProvider.js +79 -0
  327. package/lib/selections/SelectionProvider.js.map +1 -0
  328. package/lib/selections/api.helpers.d.ts +3 -0
  329. package/lib/selections/api.helpers.js +31 -0
  330. package/lib/selections/api.helpers.js.map +1 -0
  331. package/lib/selections/format.helpers.d.ts +6 -0
  332. package/lib/selections/format.helpers.js +41 -0
  333. package/lib/selections/format.helpers.js.map +1 -0
  334. package/lib/selections/hooks.d.ts +8 -0
  335. package/lib/selections/hooks.js +93 -0
  336. package/lib/selections/hooks.js.map +1 -0
  337. package/lib/selections/index.d.ts +3 -0
  338. package/lib/selections/index.js +21 -0
  339. package/lib/selections/index.js.map +1 -0
  340. package/lib/selections/types.d.ts +61 -0
  341. package/lib/selections/types.js +19 -0
  342. package/lib/selections/types.js.map +1 -0
  343. package/lib/sessions/components/alerts/PopupCreateSession.d.ts +2 -1
  344. package/lib/sessions/components/alerts/PopupCreateSession.js +2 -2
  345. package/lib/sessions/components/alerts/PopupCreateSession.js.map +1 -1
  346. package/lib/sessions/components/alerts/PopupEditSession.d.ts +2 -1
  347. package/lib/sessions/components/alerts/PopupSession.d.ts +2 -1
  348. package/lib/sessions/components/alerts/PopupSession.js +1 -0
  349. package/lib/sessions/components/alerts/PopupSession.js.map +1 -1
  350. package/lib/sessions/components/display/LogoImage.d.ts +2 -1
  351. package/lib/sessions/components/display/SessionCard.d.ts +2 -1
  352. package/lib/sessions/components/display/SessionListCard.d.ts +2 -1
  353. package/lib/sessions/components/error/ErrorText.d.ts +2 -1
  354. package/lib/sessions/components/inputs/DefaultCheckbox.d.ts +2 -1
  355. package/lib/sessions/components/inputs/PasswordInput.d.ts +2 -1
  356. package/lib/sessions/components/inputs/SessionInputs.d.ts +2 -1
  357. package/lib/sessions/components/inputs/SessionInputs.js +2 -2
  358. package/lib/sessions/components/inputs/SessionInputs.js.map +1 -1
  359. package/lib/sessions/components/inputs/SessionNameInput.d.ts +2 -1
  360. package/lib/sessions/components/inputs/UrlInput.d.ts +2 -1
  361. package/lib/sessions/components/inputs/UsernameInput.d.ts +2 -1
  362. package/lib/tools/FilePicker.d.ts +1 -1
  363. package/lib/tools/FilePicker.js +12 -14
  364. package/lib/tools/FilePicker.js.map +1 -1
  365. package/lib/tools/LinkingProvider.d.ts +5 -0
  366. package/lib/tools/LinkingProvider.js +8 -1
  367. package/lib/tools/LinkingProvider.js.map +1 -1
  368. package/lib/tools/index.d.ts +1 -0
  369. package/lib/tools/index.js +1 -0
  370. package/lib/tools/index.js.map +1 -1
  371. package/lib/tools/linking.helper.d.ts +5 -0
  372. package/lib/tools/linking.helper.js +12 -0
  373. package/lib/tools/linking.helper.js.map +1 -1
  374. package/lib/webViews/api.helpers.d.ts +4 -0
  375. package/lib/webViews/api.helpers.js +29 -0
  376. package/lib/webViews/api.helpers.js.map +1 -0
  377. package/lib/webViews/display.helpers.d.ts +1 -0
  378. package/lib/webViews/display.helpers.js +21 -0
  379. package/lib/webViews/display.helpers.js.map +1 -0
  380. package/lib/webViews/menu.helper.d.ts +29 -0
  381. package/lib/webViews/menu.helper.js +77 -0
  382. package/lib/webViews/menu.helper.js.map +1 -0
  383. package/lib/webViews/view/WebViewScreen.d.ts +8 -0
  384. package/lib/webViews/view/WebViewScreen.js +68 -0
  385. package/lib/webViews/view/WebViewScreen.js.map +1 -0
  386. package/lib/webViews/view/index.d.ts +1 -0
  387. package/lib/webViews/view/index.js +19 -0
  388. package/lib/webViews/view/index.js.map +1 -0
  389. package/package.json +51 -60
  390. package/lib/app/Module.js.map +0 -1
  391. package/lib/components/external/CameraScanner/CameraScanner.d.ts +0 -2
  392. package/lib/components/external/CameraScanner/CameraScanner.js +0 -88
  393. package/lib/components/external/CameraScanner/CameraScanner.js.map +0 -1
@@ -1,6 +1,9 @@
1
1
  export { default as AttachedFilesView } from "./AttachedFilesView/AttachedFilesView";
2
2
  export { default as MailMessageView } from "./MailMessageView/MailMessageView";
3
+ export { default as PeriodInput } from "./PeriodInput/PeriodInput";
3
4
  export { default as PopupApplicationInformation } from "./PopupApplicationInformation/PopupApplicationInformation";
4
5
  export { default as PopupMinimalRequiredVersion } from "./PopupMinimalRequiredVersion/PopupMinimalRequiredVersion";
6
+ export { default as SearchListView } from "./SearchListView/SearchListView";
7
+ export { default as SearchTreeView } from "./SearchTreeView/SearchTreeView";
5
8
  export { default as SocialNetworkLinks } from "./SocialNetworkLinks/SocialNetworkLinks";
6
9
  export { default as UserSearchBar } from "./UserSearchBar/UserSearchBar";
@@ -17,8 +17,11 @@
17
17
  */
18
18
  export { default as AttachedFilesView } from './AttachedFilesView/AttachedFilesView';
19
19
  export { default as MailMessageView } from './MailMessageView/MailMessageView';
20
+ export { default as PeriodInput } from './PeriodInput/PeriodInput';
20
21
  export { default as PopupApplicationInformation } from './PopupApplicationInformation/PopupApplicationInformation';
21
22
  export { default as PopupMinimalRequiredVersion } from './PopupMinimalRequiredVersion/PopupMinimalRequiredVersion';
23
+ export { default as SearchListView } from './SearchListView/SearchListView';
24
+ export { default as SearchTreeView } from './SearchTreeView/SearchTreeView';
22
25
  export { default as SocialNetworkLinks } from './SocialNetworkLinks/SocialNetworkLinks';
23
26
  export { default as UserSearchBar } from './UserSearchBar/UserSearchBar';
24
27
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/templates/index.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,OAAO,IAAI,iBAAiB,EAAC,MAAM,uCAAuC,CAAC;AACnF,OAAO,EAAC,OAAO,IAAI,eAAe,EAAC,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAC,OAAO,IAAI,2BAA2B,EAAC,MAAM,2DAA2D,CAAC;AACjH,OAAO,EAAC,OAAO,IAAI,2BAA2B,EAAC,MAAM,2DAA2D,CAAC;AACjH,OAAO,EAAC,OAAO,IAAI,kBAAkB,EAAC,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAC,OAAO,IAAI,aAAa,EAAC,MAAM,+BAA+B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/templates/index.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,OAAO,IAAI,iBAAiB,EAAC,MAAM,uCAAuC,CAAC;AACnF,OAAO,EAAC,OAAO,IAAI,eAAe,EAAC,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAC,OAAO,IAAI,2BAA2B,EAAC,MAAM,2DAA2D,CAAC;AACjH,OAAO,EAAC,OAAO,IAAI,2BAA2B,EAAC,MAAM,2DAA2D,CAAC;AACjH,OAAO,EAAC,OAAO,IAAI,cAAc,EAAC,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAC,OAAO,IAAI,cAAc,EAAC,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAC,OAAO,IAAI,kBAAkB,EAAC,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAC,OAAO,IAAI,aAAa,EAAC,MAAM,+BAA+B,CAAC"}
@@ -2,3 +2,4 @@ export declare function fetchDashboard({ id }: {
2
2
  id: number;
3
3
  }): Promise<any>;
4
4
  export declare function fetchDashboardConfigs(): Promise<any>;
5
+ export declare function fetchChartById(mobileChartId: any): Promise<any>;
@@ -29,4 +29,9 @@ export async function fetchDashboardConfigs() {
29
29
  url: 'ws/rest/com.axelor.apps.mobilesettings.db.MobileDashboard',
30
30
  });
31
31
  }
32
+ export async function fetchChartById(mobileChartId) {
33
+ return axiosApiProvider.get({
34
+ url: `/ws/aos/mobilechart/${mobileChartId}`,
35
+ });
36
+ }
32
37
  //# sourceMappingURL=api.helpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"api.helpers.js","sourceRoot":"","sources":["../../src/dashboards/api.helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,gBAAgB,EAAC,MAAM,iBAAiB,CAAC;AAEjD,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,EAAC,EAAE,EAAe;IACrD,IAAI,EAAE,IAAI,IAAI,EAAE;QACd,OAAO,IAAI,CAAC;KACb;IAED,OAAO,gBAAgB,CAAC,GAAG,CAAC;QAC1B,GAAG,EAAE,2BAA2B,EAAE,EAAE;KACrC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,qBAAqB;IACzC,OAAO,gBAAgB,CAAC,GAAG,CAAC;QAC1B,GAAG,EAAE,2DAA2D;KACjE,CAAC,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"api.helpers.js","sourceRoot":"","sources":["../../src/dashboards/api.helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,gBAAgB,EAAC,MAAM,iBAAiB,CAAC;AAEjD,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,EAAC,EAAE,EAAe;IACrD,IAAI,EAAE,IAAI,IAAI,EAAE;QACd,OAAO,IAAI,CAAC;KACb;IAED,OAAO,gBAAgB,CAAC,GAAG,CAAC;QAC1B,GAAG,EAAE,2BAA2B,EAAE,EAAE;KACrC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,qBAAqB;IACzC,OAAO,gBAAgB,CAAC,GAAG,CAAC;QAC1B,GAAG,EAAE,2DAA2D;KACjE,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,aAAa;IAChD,OAAO,gBAAgB,CAAC,GAAG,CAAC;QAC1B,GAAG,EAAE,uBAAuB,aAAa,EAAE;KAC5C,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ declare const AOPChart: ({ actionViewName, widthGraph, }: {
3
+ actionViewName: string;
4
+ widthGraph?: number;
5
+ }) => React.JSX.Element;
6
+ export default AOPChart;
@@ -0,0 +1,67 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2024 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import React, { useEffect, useState } from 'react';
19
+ import { ChartRender } from '@axelor/aos-mobile-ui';
20
+ import { fetchActionView, fetchChartDataset, fetchTypeChart, getChartParameter, } from './api.helpers';
21
+ import { transformData } from './format.helpers';
22
+ const DEFAULT_CHART_CONFIG = { type: '', dataset: [], title: '' };
23
+ const AOPChart = ({ actionViewName, widthGraph, }) => {
24
+ const [chart, setChart] = useState(DEFAULT_CHART_CONFIG);
25
+ useEffect(() => {
26
+ const fetchChartData = async () => {
27
+ let result = { ...DEFAULT_CHART_CONFIG };
28
+ try {
29
+ const actionViewResponse = await fetchActionView({
30
+ actionViewName: actionViewName,
31
+ });
32
+ const context = actionViewResponse?.data?.data[0]?.view?.context;
33
+ const chartName = actionViewResponse?.data?.data[0]?.view.views[0].name;
34
+ const typeResponse = await fetchTypeChart({ chartName: chartName });
35
+ result.title = typeResponse?.data?.data?.title;
36
+ result.type = typeResponse?.data?.data?.series[0].type;
37
+ const onInit = typeResponse?.data?.data?.onInit;
38
+ let parameter = null;
39
+ if (onInit) {
40
+ const paramResponse = await getChartParameter({
41
+ chartName,
42
+ action: onInit,
43
+ context: context,
44
+ });
45
+ parameter = paramResponse?.data?.data[0].values;
46
+ }
47
+ const datasetResponse = await fetchChartDataset({
48
+ chartName,
49
+ parameter,
50
+ context,
51
+ });
52
+ result.dataset = datasetResponse?.data?.data?.dataset;
53
+ }
54
+ catch (error) {
55
+ result = { ...DEFAULT_CHART_CONFIG };
56
+ }
57
+ setChart(result);
58
+ };
59
+ fetchChartData();
60
+ }, [actionViewName]);
61
+ if (chart.dataset?.length <= 0) {
62
+ return null;
63
+ }
64
+ return (<ChartRender dataList={transformData(chart.dataset)} title={chart.title} type={chart.type} widthGraph={widthGraph}/>);
65
+ };
66
+ export default AOPChart;
67
+ //# sourceMappingURL=AOPChart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AOPChart.js","sourceRoot":"","sources":["../../../../src/dashboards/component/AOPChart/AOPChart.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,SAAS,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AACjD,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAC;AAClD,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAE/C,MAAM,oBAAoB,GAAG,EAAC,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAC,CAAC;AAEhE,MAAM,QAAQ,GAAG,CAAC,EAChB,cAAc,EACd,UAAU,GAIX,EAAE,EAAE;IACH,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,oBAAoB,CAAC,CAAC;IAEzD,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,cAAc,GAAG,KAAK,IAAI,EAAE;YAChC,IAAI,MAAM,GAAG,EAAC,GAAG,oBAAoB,EAAC,CAAC;YAEvC,IAAI;gBACF,MAAM,kBAAkB,GAAG,MAAM,eAAe,CAAC;oBAC/C,cAAc,EAAE,cAAc;iBAC/B,CAAC,CAAC;gBAEH,MAAM,OAAO,GAAG,kBAAkB,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC;gBACjE,MAAM,SAAS,GAAG,kBAAkB,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC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CAAC,CACvC,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CACnB,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CACjB,UAAU,CAAC,CAAC,UAAU,CAAC,EACvB,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,16 @@
1
+ export declare function fetchActionView({ actionViewName }: {
2
+ actionViewName: any;
3
+ }): Promise<any>;
4
+ export declare function fetchTypeChart({ chartName }: {
5
+ chartName: string;
6
+ }): Promise<any>;
7
+ export declare function fetchChartDataset({ chartName, parameter, context }: {
8
+ chartName: any;
9
+ parameter: any;
10
+ context: any;
11
+ }): Promise<any>;
12
+ export declare function getChartParameter({ action, chartName, context }: {
13
+ action: any;
14
+ chartName: any;
15
+ context: any;
16
+ }): Promise<any>;
@@ -0,0 +1,59 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2024 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import { axiosApiProvider } from '../../../apiProviders';
19
+ export async function fetchActionView({ actionViewName }) {
20
+ return axiosApiProvider.post({
21
+ url: `/ws/action/${actionViewName}`,
22
+ data: {
23
+ data: {
24
+ context: {
25
+ _id: null,
26
+ },
27
+ },
28
+ model: 'com.axelor.meta.db.MetaAction',
29
+ },
30
+ });
31
+ }
32
+ export async function fetchTypeChart({ chartName }) {
33
+ return axiosApiProvider.get({ url: `/ws/meta/chart/${chartName}` });
34
+ }
35
+ export async function fetchChartDataset({ chartName, parameter, context }) {
36
+ return axiosApiProvider.post({
37
+ url: `/ws/meta/chart/${chartName}`,
38
+ data: {
39
+ data: { ...parameter, ...context },
40
+ fields: ['dataset'],
41
+ },
42
+ });
43
+ }
44
+ export async function getChartParameter({ action, chartName, context }) {
45
+ return axiosApiProvider.post({
46
+ url: 'ws/action',
47
+ data: {
48
+ action: action,
49
+ data: {
50
+ context: {
51
+ ...context,
52
+ _chart: chartName,
53
+ },
54
+ },
55
+ model: 'com.axelor.script.ScriptBindings',
56
+ },
57
+ });
58
+ }
59
+ //# sourceMappingURL=api.helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.helpers.js","sourceRoot":"","sources":["../../../../src/dashboards/component/AOPChart/api.helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,gBAAgB,EAAC,MAAM,uBAAuB,CAAC;AAEvD,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,EAAC,cAAc,EAAC;IACpD,OAAO,gBAAgB,CAAC,IAAI,CAAC;QAC3B,GAAG,EAAE,cAAc,cAAc,EAAE;QACnC,IAAI,EAAE;YACJ,IAAI,EAAE;gBACJ,OAAO,EAAE;oBACP,GAAG,EAAE,IAAI;iBACV;aACF;YACD,KAAK,EAAE,+BAA+B;SACvC;KACF,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,EAAC,SAAS,EAAsB;IACnE,OAAO,gBAAgB,CAAC,GAAG,CAAC,EAAC,GAAG,EAAE,kBAAkB,SAAS,EAAE,EAAC,CAAC,CAAC;AACpE,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,EAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAC;IACrE,OAAO,gBAAgB,CAAC,IAAI,CAAC;QAC3B,GAAG,EAAE,kBAAkB,SAAS,EAAE;QAClC,IAAI,EAAE;YACJ,IAAI,EAAE,EAAC,GAAG,SAAS,EAAE,GAAG,OAAO,EAAC;YAChC,MAAM,EAAE,CAAC,SAAS,CAAC;SACpB;KACF,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,EAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAC;IAClE,OAAO,gBAAgB,CAAC,IAAI,CAAC;QAC3B,GAAG,EAAE,WAAW;QAChB,IAAI,EAAE;YACJ,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,OAAO,EAAE;oBACP,GAAG,OAAO;oBACV,MAAM,EAAE,SAAS;iBAClB;aACF;YACD,KAAK,EAAE,kCAAkC;SAC1C;KACF,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,11 @@
1
+ interface Data {
2
+ label: string;
3
+ value: number;
4
+ }
5
+ interface AxesKeys {
6
+ valueKey: string;
7
+ labelKey: string;
8
+ }
9
+ export declare const getAxesKeys: (data: any) => AxesKeys;
10
+ export declare const transformData: (data: any[]) => Data[][];
11
+ export {};
@@ -0,0 +1,47 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2024 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ export const getAxesKeys = (data) => {
19
+ const sample = data[0];
20
+ let valueKey = '';
21
+ let labelKey = '';
22
+ Object.keys(sample).forEach(key => {
23
+ const value = sample[key];
24
+ if (!isNaN(parseFloat(value)) && valueKey === '') {
25
+ valueKey = key;
26
+ }
27
+ else if (labelKey === '') {
28
+ labelKey = key;
29
+ }
30
+ });
31
+ if (valueKey === '' || labelKey === '') {
32
+ throw new Error("Couldn't find appropriate keys for value and label in data.");
33
+ }
34
+ return { valueKey, labelKey };
35
+ };
36
+ export const transformData = (data) => {
37
+ if (!Array.isArray(data) || data.length === 0) {
38
+ return [[]];
39
+ }
40
+ const { valueKey, labelKey } = getAxesKeys(data);
41
+ const transformed = data.map(item => ({
42
+ label: item[labelKey],
43
+ value: parseFloat(item[valueKey]) || 0,
44
+ }));
45
+ return [transformed];
46
+ };
47
+ //# sourceMappingURL=format.helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format.helpers.js","sourceRoot":"","sources":["../../../../src/dashboards/component/AOPChart/format.helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAYH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAS,EAAY,EAAE;IACjD,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IACvB,IAAI,QAAQ,GAAW,EAAE,CAAC;IAC1B,IAAI,QAAQ,GAAW,EAAE,CAAC;IAE1B,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;QAChC,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QAC1B,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,IAAI,QAAQ,KAAK,EAAE,EAAE;YAChD,QAAQ,GAAG,GAAG,CAAC;SAChB;aAAM,IAAI,QAAQ,KAAK,EAAE,EAAE;YAC1B,QAAQ,GAAG,GAAG,CAAC;SAChB;IACH,CAAC,CAAC,CAAC;IAEH,IAAI,QAAQ,KAAK,EAAE,IAAI,QAAQ,KAAK,EAAE,EAAE;QACtC,MAAM,IAAI,KAAK,CACb,6DAA6D,CAC9D,CAAC;KACH;IAED,OAAO,EAAC,QAAQ,EAAE,QAAQ,EAAC,CAAC;AAC9B,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,IAAW,EAAY,EAAE;IACrD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;QAC7C,OAAO,CAAC,EAAE,CAAC,CAAC;KACb;IAED,MAAM,EAAC,QAAQ,EAAE,QAAQ,EAAC,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IAE/C,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACpC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC;QACrB,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC;KACvC,CAAC,CAAC,CAAC;IAEJ,OAAO,CAAC,WAAW,CAAC,CAAC;AACvB,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ interface RefreshChartProps {
3
+ style?: any;
4
+ chartId: number;
5
+ hideCardBackground?: boolean;
6
+ }
7
+ declare const RefreshChart: ({ style, chartId, hideCardBackground, }: RefreshChartProps) => React.JSX.Element;
8
+ export default RefreshChart;
@@ -0,0 +1,83 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2024 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import React, { useEffect, useMemo, useState } from 'react';
19
+ import { StyleSheet, View } from 'react-native';
20
+ import { ChartRender, Icon } from '@axelor/aos-mobile-ui';
21
+ import { fetchChartById } from '../../api.helpers';
22
+ import AOPChart from '../AOPChart/AOPChart';
23
+ const DEFAULT_CONFIG = {
24
+ dataList: [],
25
+ chartName: null,
26
+ chartType: null,
27
+ actionViewName: null,
28
+ };
29
+ const RefreshChart = ({ style, chartId, hideCardBackground = false, }) => {
30
+ const [charConfig, setChartConfig] = useState(DEFAULT_CONFIG);
31
+ useEffect(() => {
32
+ refreshChart(chartId);
33
+ }, [chartId]);
34
+ const refreshChart = _chartId => {
35
+ fetchChartById(_chartId)
36
+ .then(res => {
37
+ const { data } = res;
38
+ if (data?.object?.metaActionName) {
39
+ setChartConfig({
40
+ ...DEFAULT_CONFIG,
41
+ actionViewName: data.object.metaActionName,
42
+ });
43
+ }
44
+ else {
45
+ setChartConfig({
46
+ ...DEFAULT_CONFIG,
47
+ dataList: [data.object.valueList],
48
+ chartName: data.object.chartName,
49
+ chartType: data.object.chartType,
50
+ });
51
+ }
52
+ })
53
+ .catch(() => {
54
+ setChartConfig(DEFAULT_CONFIG);
55
+ });
56
+ };
57
+ const content = useMemo(() => {
58
+ if (charConfig.actionViewName) {
59
+ return <AOPChart actionViewName={charConfig.actionViewName}/>;
60
+ }
61
+ else if (charConfig.dataList.length > 0 && charConfig.chartType) {
62
+ return (<ChartRender dataList={charConfig.dataList} title={charConfig.chartName} type={charConfig.chartType} hideCardBackground={hideCardBackground}/>);
63
+ }
64
+ return null;
65
+ }, [charConfig, hideCardBackground]);
66
+ if (content == null) {
67
+ return null;
68
+ }
69
+ return (<View style={style}>
70
+ {content}
71
+ <Icon name="arrow-clockwise" style={styles.icon} touchable={true} onPress={() => refreshChart(chartId)}/>
72
+ </View>);
73
+ };
74
+ const styles = StyleSheet.create({
75
+ icon: {
76
+ position: 'absolute',
77
+ right: 10,
78
+ top: 10,
79
+ zIndex: 1,
80
+ },
81
+ });
82
+ export default RefreshChart;
83
+ //# sourceMappingURL=RefreshChart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RefreshChart.js","sourceRoot":"","sources":["../../../../src/dashboards/component/RefreshChart/RefreshChart.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAC,UAAU,EAAE,IAAI,EAAC,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAC,WAAW,EAAE,IAAI,EAAC,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAC,cAAc,EAAC,MAAM,mBAAmB,CAAC;AACjD,OAAO,QAAQ,MAAM,sBAAsB,CAAC;AAE5C,MAAM,cAAc,GAAG;IACrB,QAAQ,EAAE,EAAE;IACZ,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,cAAc,EAAE,IAAI;CACrB,CAAC;AAQF,MAAM,YAAY,GAAG,CAAC,EACpB,KAAK,EACL,OAAO,EACP,kBAAkB,GAAG,KAAK,GACR,EAAE,EAAE;IACtB,MAAM,CAAC,UAAU,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,cAAc,CAAC,CAAC;IAE9D,SAAS,CAAC,GAAG,EAAE;QACb,YAAY,CAAC,OAAO,CAAC,CAAC;IACxB,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAEd,MAAM,YAAY,GAAG,QAAQ,CAAC,EAAE;QAC9B,cAAc,CAAC,QAAQ,CAAC;aACrB,IAAI,CAAC,GAAG,CAAC,EAAE;YACV,MAAM,EAAC,IAAI,EAAC,GAAG,GAAG,CAAC;YAEnB,IAAI,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE;gBAChC,cAAc,CAAC;oBACb,GAAG,cAAc;oBACjB,cAAc,EAAE,IAAI,CAAC,MAAM,CAAC,cAAc;iBAC3C,CAAC,CAAC;aACJ;iBAAM;gBACL,cAAc,CAAC;oBACb,GA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,YAAY,CAAC,OAAO,CAAC,CAAC,EAEzC;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,IAAI,EAAE;QACJ,QAAQ,EAAE,UAAU;QACpB,KAAK,EAAE,EAAE;QACT,GAAG,EAAE,EAAE;QACP,MAAM,EAAE,CAAC;KACV;CACF,CAAC,CAAC;AAEH,eAAe,YAAY,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default as AOPChart } from "./AOPChart/AOPChart";
2
+ export { default as RefreshChart } from "./RefreshChart/RefreshChart";
@@ -0,0 +1,20 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2024 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ export { default as AOPChart } from './AOPChart/AOPChart';
19
+ export { default as RefreshChart } from './RefreshChart/RefreshChart';
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/dashboards/component/index.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,OAAO,IAAI,QAAQ,EAAC,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,6BAA6B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./component";
2
+ export * from "./view";
@@ -0,0 +1,20 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2024 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ export * from './component';
19
+ export * from './view';
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dashboards/index.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC"}
@@ -1,4 +1,4 @@
1
- import { Menu, Module, Screen } from '../app';
1
+ import { Menu, Screen } from '../app';
2
2
  type DashboardMenuConfig = {
3
3
  [menuKey: string]: {
4
4
  menu: Menu;
@@ -26,27 +26,4 @@ export declare const createDashboardScreens: (dashboardConfigs: {
26
26
  export declare const filterAuthorizedDashboardMenus: (dashboardConfigs: DashboardMenuConfig, { roles: userRoles }: {
27
27
  roles: any[];
28
28
  }) => Menus;
29
- export declare const addDashboardMenus: (modules: Module[], dashboardMenus: Menus) => {
30
- menus: {
31
- [x: string]: Menu;
32
- };
33
- name: string;
34
- title?: string;
35
- subtitle?: string;
36
- icon?: string;
37
- compatibilityAOS?: import("../app/Module").Compatibility;
38
- disabled?: boolean;
39
- screens?: {
40
- [screenKey: string]: Screen;
41
- };
42
- translations?: {
43
- [languageKey: string]: any;
44
- };
45
- reducers?: {
46
- [key: string]: import("redux").Reducer;
47
- };
48
- backgroundFunctions?: Function[];
49
- models?: import("../app").Models;
50
- requiredConfig?: string[];
51
- }[];
52
29
  export {};
@@ -77,13 +77,4 @@ export const filterAuthorizedDashboardMenus = (dashboardConfigs, { roles: userRo
77
77
  });
78
78
  return menus;
79
79
  };
80
- export const addDashboardMenus = (modules, dashboardMenus) => {
81
- return modules.map(_module => {
82
- const associatedMenus = Object.fromEntries(Object.entries(dashboardMenus).filter(([, { parent }]) => parent === _module.name));
83
- return {
84
- ..._module,
85
- menus: { ...(_module.menus ?? {}), ...(associatedMenus ?? {}) },
86
- };
87
- });
88
- };
89
80
  //# sourceMappingURL=menu.helpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"menu.helpers.js","sourceRoot":"","sources":["../../src/dashboards/menu.helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAC,uBAAuB,EAAC,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAC,eAAe,EAAC,MAAM,QAAQ,CAAC;AAcvC,MAAM,qBAAqB,GAAG,EAAE,CAAC,EAAE;IACjC,OAAO,KAAK,CAAC,EAAE,CAAC,eAAe,CAAC,EAAC,GAAG,KAAK,EAAE,WAAW,EAAE,EAAE,EAAC,CAAC,CAAC;AAC/D,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,gBAQG,EAC6C,EAAE;IAClD,MAAM,OAAO,GAAY,EAAE,CAAC;IAC5B,MAAM,KAAK,GAAwB,EAAE,CAAC;IAEtC,IAAI,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE;QAClE,gBAAgB,CAAC,OAAO,CACtB,CAAC,EACC,EAAE,EACF,OAAO,EACP,QAAQ,GAAG,KAAK,EAChB,SAAS,EACT,QAAQ,EACR,SAAS,EACT,iBAAiB,GAAG,EAAE,GACvB,EAAE,EAAE;YACH,MAAM,MAAM,GAAG,QAAQ;gBACrB,CAAC,CAAC;oBACE,KAAK,EAAE,SAAS,IAAI,gBAA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AAW,CAAC,EAAE,CAAC,CAC7D,CAAC;SACH;IACH,CAAC,CAAC;SACD,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,EAAC,IAAI,EAAC,CAAC,EAAE,EAAE;QACzB,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;IACpB,CAAC,CAAC,CAAC;IAEL,OAAO,KAAK,CAAC;AACf,CAAC,CAAC"}
@@ -1,4 +1,8 @@
1
- export declare const DashboardScreen: ({ dashboardId, hideCardBackground }: {
2
- dashboardId: any;
1
+ import React from 'react';
2
+ interface DashboardScreenProps {
3
+ dashboardId: number;
3
4
  hideCardBackground?: boolean;
4
- }) => JSX.Element;
5
+ chartWidth?: number;
6
+ }
7
+ export declare const DashboardScreen: ({ dashboardId, hideCardBackground, chartWidth, }: DashboardScreenProps) => React.JSX.Element;
8
+ export {};
@@ -15,70 +15,9 @@
15
15
  * You should have received a copy of the GNU Affero General Public License
16
16
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
17
  */
18
- import React, { useCallback, useEffect, useMemo, useState } from 'react';
19
- import { Dashboard, WarningCard } from '@axelor/aos-mobile-ui';
20
- import { headerActionsProvider } from '../../header';
21
- import { useTranslator } from '../../i18n';
22
- import { createDashboardActionID } from '../display.helpers';
23
- import { ActivityIndicator } from 'react-native';
24
- import { fetchDashboard } from '../api.helpers';
25
- import { formatDateTime } from '../../utils';
26
- export const DashboardScreen = ({ dashboardId, hideCardBackground = false }) => {
27
- const I18n = useTranslator();
28
- const [dashboard, setDashboard] = useState({});
29
- const [loading, setLoading] = useState(false);
30
- const [lastUpdate, setLastUpdate] = useState(new Date());
31
- const refresh = useCallback(() => {
32
- setLoading(true);
33
- fetchDashboard({ id: dashboardId })
34
- .then(response => {
35
- setDashboard({ ...(response?.data?.object ?? {}), id: dashboardId });
36
- setLastUpdate(new Date());
37
- })
38
- .catch(() => setDashboard({}))
39
- .finally(() => setLoading(false));
40
- }, [dashboardId]);
41
- useEffect(() => {
42
- let isMounted = true;
43
- if (isMounted) {
44
- refresh();
45
- }
46
- return () => {
47
- isMounted = false;
48
- };
49
- }, [refresh]);
50
- useEffect(() => {
51
- headerActionsProvider.registerModel(createDashboardActionID(dashboardId), {
52
- actions: [
53
- {
54
- key: 'refreshConfig',
55
- order: 10,
56
- showInHeader: false,
57
- iconName: 'arrow-repeat',
58
- title: I18n.t('Base_Dashboard_RefreshConfig'),
59
- onPress: refresh,
60
- },
61
- ],
62
- });
63
- }, [I18n, dashboardId, refresh]);
64
- const dashboardData = useMemo(() => {
65
- if (!Array.isArray(dashboard?.dashboardLineList)) {
66
- return [];
67
- }
68
- return dashboard?.dashboardLineList.map(elt => ({
69
- graphList: elt.chartList.map(ch => ({
70
- type: ch.chartType,
71
- dataList: [ch.valueList],
72
- title: ch?.chartName,
73
- })),
74
- }));
75
- }, [dashboard]);
76
- if (loading) {
77
- return <ActivityIndicator size="large"/>;
78
- }
79
- if (!Array.isArray(dashboardData) || dashboardData.length === 0) {
80
- return (<WarningCard errorMessage={I18n.t('Base_Dashboard_Misconfigured')}/>);
81
- }
82
- return (<Dashboard lineList={dashboardData} hideCardBackground={hideCardBackground} translator={I18n.t} lastUpdate={formatDateTime(lastUpdate, I18n.t('Base_DateTimeFormat'))} displayLastUpdate={true}/>);
18
+ import React from 'react';
19
+ import { DashboardView } from './DashboardView';
20
+ export const DashboardScreen = ({ dashboardId, hideCardBackground, chartWidth, }) => {
21
+ return (<DashboardView dashboardId={dashboardId} isHeaderAction={true} hideCardBackground={hideCardBackground} displayLastUpdate={true} chartWidth={chartWidth}/>);
83
22
  };
84
23
  //# sourceMappingURL=DashboardScreen.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DashboardScreen.js","sourceRoot":"","sources":["../../../src/dashboards/view/DashboardScreen.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAC,MAAM,OAAO,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@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ interface DashboardViewProps {
3
+ dashboardId: number;
4
+ isHeaderAction?: boolean;
5
+ hideCardBackground?: boolean;
6
+ displayLastUpdate?: boolean;
7
+ chartWidth?: number;
8
+ }
9
+ export declare const DashboardView: ({ dashboardId, isHeaderAction, hideCardBackground, displayLastUpdate, chartWidth, }: DashboardViewProps) => React.JSX.Element;
10
+ export {};