@axelor/aos-mobile-core 7.1.1 → 7.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (298) hide show
  1. package/lib/api/anomaly-api.d.ts +4 -0
  2. package/lib/api/anomaly-api.js +24 -0
  3. package/lib/api/anomaly-api.js.map +1 -0
  4. package/lib/api/login-api.js +2 -3
  5. package/lib/api/login-api.js.map +1 -1
  6. package/lib/api/metafile-api.d.ts +10 -0
  7. package/lib/api/metafile-api.js +12 -6
  8. package/lib/api/metafile-api.js.map +1 -1
  9. package/lib/api/mobile-config-api.js +9 -15
  10. package/lib/api/mobile-config-api.js.map +1 -1
  11. package/lib/api/model-api.d.ts +4 -0
  12. package/lib/api/model-api.js +28 -0
  13. package/lib/api/model-api.js.map +1 -0
  14. package/lib/api/user-api.d.ts +4 -0
  15. package/lib/api/user-api.js +31 -0
  16. package/lib/api/user-api.js.map +1 -0
  17. package/lib/apiProviders/Standard/ObjectFieldsProvider.d.ts +1 -0
  18. package/lib/apiProviders/Standard/ObjectFieldsProvider.js +21 -4
  19. package/lib/apiProviders/Standard/ObjectFieldsProvider.js.map +1 -1
  20. package/lib/apiProviders/middlewares/fieldParser.d.ts +2 -0
  21. package/lib/apiProviders/middlewares/fieldParser.js +53 -0
  22. package/lib/apiProviders/middlewares/fieldParser.js.map +1 -0
  23. package/lib/apiProviders/middlewares/index.d.ts +1 -0
  24. package/lib/apiProviders/middlewares/index.js +1 -0
  25. package/lib/apiProviders/middlewares/index.js.map +1 -1
  26. package/lib/apiProviders/utils.js +16 -4
  27. package/lib/apiProviders/utils.js.map +1 -1
  28. package/lib/app/ContextsProvider.js +12 -4
  29. package/lib/app/ContextsProvider.js.map +1 -1
  30. package/lib/app/Module.d.ts +2 -0
  31. package/lib/app/RootNavigator.js +1 -1
  32. package/lib/app/context.helper.js +6 -1
  33. package/lib/app/context.helper.js.map +1 -1
  34. package/lib/auth/components/index.d.ts +1 -0
  35. package/lib/{sessions/components/buttons → auth/components}/index.js +1 -3
  36. package/lib/auth/components/index.js.map +1 -0
  37. package/lib/auth/components/molecules/TranslationsButton/TranslationsButton.d.ts +2 -0
  38. package/lib/auth/components/molecules/TranslationsButton/TranslationsButton.js +63 -0
  39. package/lib/auth/components/molecules/TranslationsButton/TranslationsButton.js.map +1 -0
  40. package/lib/auth/components/molecules/index.d.ts +1 -0
  41. package/lib/auth/components/molecules/index.js +19 -0
  42. package/lib/auth/components/molecules/index.js.map +1 -0
  43. package/lib/auth/features/companySlice.d.ts +1 -1
  44. package/lib/auth/features/configSlice.d.ts +1 -1
  45. package/lib/auth/features/languageSlice.d.ts +1 -1
  46. package/lib/auth/features/userSlice.d.ts +1 -1
  47. package/lib/auth/features/userSlice.js +0 -4
  48. package/lib/auth/features/userSlice.js.map +1 -1
  49. package/lib/auth/models/objectFields.js +3 -3
  50. package/lib/auth/models/objectFields.js.map +1 -1
  51. package/lib/auth/screens/SettingsScreen.js +7 -31
  52. package/lib/auth/screens/SettingsScreen.js.map +1 -1
  53. package/lib/auth/screens/UserScreen.js +11 -8
  54. package/lib/auth/screens/UserScreen.js.map +1 -1
  55. package/lib/components/external/Camera/Camera.js +15 -5
  56. package/lib/components/external/Camera/Camera.js.map +1 -1
  57. package/lib/components/external/Camera/CaptureButton.d.ts +2 -1
  58. package/lib/components/external/Camera/CaptureButton.js +3 -3
  59. package/lib/components/external/Camera/CaptureButton.js.map +1 -1
  60. package/lib/components/external/Stopwatch/Stopwatch.d.ts +5 -1
  61. package/lib/components/external/Stopwatch/Stopwatch.js +35 -11
  62. package/lib/components/external/Stopwatch/Stopwatch.js.map +1 -1
  63. package/lib/components/external/Timer/Timer.d.ts +3 -2
  64. package/lib/components/external/Timer/Timer.js +5 -4
  65. package/lib/components/external/Timer/Timer.js.map +1 -1
  66. package/lib/components/index.d.ts +1 -0
  67. package/lib/components/index.js +1 -0
  68. package/lib/components/index.js.map +1 -1
  69. package/lib/components/molecules/CameraButton/CameraButton.d.ts +12 -0
  70. package/lib/components/molecules/CameraButton/CameraButton.js +87 -0
  71. package/lib/components/molecules/CameraButton/CameraButton.js.map +1 -0
  72. package/lib/components/molecules/UploadFileInput/UploadFileInput.d.ts +3 -1
  73. package/lib/components/molecules/UploadFileInput/UploadFileInput.js +71 -15
  74. package/lib/components/molecules/UploadFileInput/UploadFileInput.js.map +1 -1
  75. package/lib/components/molecules/index.d.ts +1 -0
  76. package/lib/components/molecules/index.js +1 -0
  77. package/lib/components/molecules/index.js.map +1 -1
  78. package/lib/components/organisms/AnomalyBubble/AnomalyBubble.d.ts +11 -0
  79. package/lib/components/organisms/AnomalyBubble/AnomalyBubble.js +60 -0
  80. package/lib/components/organisms/AnomalyBubble/AnomalyBubble.js.map +1 -0
  81. package/lib/components/organisms/AnomalyList/AnomalyList.d.ts +7 -0
  82. package/lib/components/organisms/AnomalyList/AnomalyList.js +59 -0
  83. package/lib/components/organisms/AnomalyList/AnomalyList.js.map +1 -0
  84. package/lib/components/organisms/HeaderOptionsMenu/HeaderOptionsMenu.d.ts +3 -1
  85. package/lib/components/organisms/HeaderOptionsMenu/HeaderOptionsMenu.js +18 -4
  86. package/lib/components/organisms/HeaderOptionsMenu/HeaderOptionsMenu.js.map +1 -1
  87. package/lib/components/organisms/ScannerAutocompleteSearch/ScannerAutocompleteSearch.d.ts +4 -1
  88. package/lib/components/organisms/ScannerAutocompleteSearch/ScannerAutocompleteSearch.js +2 -2
  89. package/lib/components/organisms/ScannerAutocompleteSearch/ScannerAutocompleteSearch.js.map +1 -1
  90. package/lib/components/organisms/index.d.ts +2 -0
  91. package/lib/components/organisms/index.js +2 -0
  92. package/lib/components/organisms/index.js.map +1 -1
  93. package/lib/components/pages/FormView/Alerts/ConstraintsValidatorPopup.d.ts +11 -0
  94. package/lib/components/pages/FormView/Alerts/ConstraintsValidatorPopup.js +33 -0
  95. package/lib/components/pages/FormView/Alerts/ConstraintsValidatorPopup.js.map +1 -0
  96. package/lib/components/pages/FormView/Alerts/index.d.ts +1 -0
  97. package/lib/components/pages/FormView/Alerts/index.js +19 -0
  98. package/lib/components/pages/FormView/Alerts/index.js.map +1 -0
  99. package/lib/components/pages/FormView/Components/Field.d.ts +9 -0
  100. package/lib/components/pages/FormView/Components/Field.js +149 -0
  101. package/lib/components/pages/FormView/Components/Field.js.map +1 -0
  102. package/lib/components/pages/FormView/Components/Panel.d.ts +8 -0
  103. package/lib/components/pages/FormView/Components/Panel.js +84 -0
  104. package/lib/components/pages/FormView/Components/Panel.js.map +1 -0
  105. package/lib/components/pages/FormView/Components/index.d.ts +2 -0
  106. package/lib/components/pages/FormView/Components/index.js +20 -0
  107. package/lib/components/pages/FormView/Components/index.js.map +1 -0
  108. package/lib/components/pages/FormView/Custom/CustomButton.d.ts +10 -0
  109. package/lib/components/pages/FormView/Custom/CustomButton.js +31 -0
  110. package/lib/components/pages/FormView/Custom/CustomButton.js.map +1 -0
  111. package/lib/components/pages/FormView/Custom/CustomPasswordInput.d.ts +11 -0
  112. package/lib/components/pages/FormView/Custom/CustomPasswordInput.js +40 -0
  113. package/lib/components/pages/FormView/Custom/CustomPasswordInput.js.map +1 -0
  114. package/lib/components/pages/FormView/Custom/CustomPicker.d.ts +12 -0
  115. package/lib/components/pages/FormView/Custom/CustomPicker.js +33 -0
  116. package/lib/components/pages/FormView/Custom/CustomPicker.js.map +1 -0
  117. package/lib/components/pages/FormView/Custom/CustomSearchBar.d.ts +12 -0
  118. package/lib/components/pages/FormView/Custom/CustomSearchBar.js +69 -0
  119. package/lib/components/pages/FormView/Custom/CustomSearchBar.js.map +1 -0
  120. package/lib/components/pages/FormView/Custom/index.d.ts +4 -0
  121. package/lib/components/pages/FormView/Custom/index.js +22 -0
  122. package/lib/components/pages/FormView/Custom/index.js.map +1 -0
  123. package/lib/components/pages/FormView/FormView.d.ts +8 -0
  124. package/lib/components/pages/FormView/FormView.js +199 -0
  125. package/lib/components/pages/FormView/FormView.js.map +1 -0
  126. package/lib/components/pages/index.d.ts +4 -0
  127. package/lib/components/pages/index.js +22 -0
  128. package/lib/components/pages/index.js.map +1 -0
  129. package/lib/components/templates/AttachedFilesView/AttachedFilesView.js +1 -1
  130. package/lib/components/templates/AttachedFilesView/AttachedFilesView.js.map +1 -1
  131. package/lib/components/templates/MailMessageView/MailMessageView.js +8 -2
  132. package/lib/components/templates/MailMessageView/MailMessageView.js.map +1 -1
  133. package/lib/components/templates/PopupApplicationNotConfigured/PopupApplicationNotConfigured.js +10 -13
  134. package/lib/components/templates/PopupApplicationNotConfigured/PopupApplicationNotConfigured.js.map +1 -1
  135. package/lib/components/templates/PopupMinimalRequiredVersion/PopupMinimalRequiredVersion.js +15 -25
  136. package/lib/components/templates/PopupMinimalRequiredVersion/PopupMinimalRequiredVersion.js.map +1 -1
  137. package/lib/components/templates/SocialNetworkLinks/SocialNetworkLinks.d.ts +16 -0
  138. package/lib/components/templates/SocialNetworkLinks/SocialNetworkLinks.js +78 -0
  139. package/lib/components/templates/SocialNetworkLinks/SocialNetworkLinks.js.map +1 -0
  140. package/lib/components/templates/UserSearchBar/UserSearchBar.d.ts +14 -0
  141. package/lib/components/templates/UserSearchBar/UserSearchBar.js +34 -0
  142. package/lib/components/templates/UserSearchBar/UserSearchBar.js.map +1 -0
  143. package/lib/components/templates/index.d.ts +2 -0
  144. package/lib/components/templates/index.js +2 -0
  145. package/lib/components/templates/index.js.map +1 -1
  146. package/lib/config/routes.d.ts +23 -20
  147. package/lib/config/routes.js +2 -0
  148. package/lib/config/routes.js.map +1 -1
  149. package/lib/features/attachedFilesSlice.d.ts +1 -1
  150. package/lib/features/authSlice.d.ts +1 -1
  151. package/lib/features/cameraScannerSlice.d.ts +2 -2
  152. package/lib/features/cameraScannerSlice.js +4 -1
  153. package/lib/features/cameraScannerSlice.js.map +1 -1
  154. package/lib/features/cameraSlice.d.ts +13 -4
  155. package/lib/features/cameraSlice.js +4 -1
  156. package/lib/features/cameraSlice.js.map +1 -1
  157. package/lib/features/formSlice.d.ts +34 -0
  158. package/lib/features/formSlice.js +70 -0
  159. package/lib/features/formSlice.js.map +1 -0
  160. package/lib/features/index.d.ts +3 -0
  161. package/lib/features/index.js +3 -0
  162. package/lib/features/index.js.map +1 -1
  163. package/lib/features/mailMessageSlice.d.ts +1 -1
  164. package/lib/features/menuConfigSlice.d.ts +1 -1
  165. package/lib/features/metaJsonFieldSlice.d.ts +34 -0
  166. package/lib/features/metaJsonFieldSlice.js +68 -0
  167. package/lib/features/metaJsonFieldSlice.js.map +1 -0
  168. package/lib/features/metaModuleSlice.d.ts +1 -1
  169. package/lib/features/metafileSlice.d.ts +1 -1
  170. package/lib/features/mobileConfigSlice.d.ts +1 -1
  171. package/lib/features/onlineSlice.d.ts +1 -1
  172. package/lib/features/scannerSlice.d.ts +2 -2
  173. package/lib/features/scannerSlice.js +4 -1
  174. package/lib/features/scannerSlice.js.map +1 -1
  175. package/lib/features/userSlice.d.ts +16 -0
  176. package/lib/features/userSlice.js +49 -0
  177. package/lib/features/userSlice.js.map +1 -0
  178. package/lib/forms/FormConfigsProvider.d.ts +20 -0
  179. package/lib/forms/FormConfigsProvider.js +56 -0
  180. package/lib/forms/FormConfigsProvider.js.map +1 -0
  181. package/lib/forms/api.helpers.d.ts +12 -0
  182. package/lib/forms/api.helpers.js +59 -0
  183. package/lib/forms/api.helpers.js.map +1 -0
  184. package/lib/forms/display.helpers.d.ts +9 -0
  185. package/lib/forms/display.helpers.js +150 -0
  186. package/lib/forms/display.helpers.js.map +1 -0
  187. package/lib/forms/index.d.ts +7 -0
  188. package/lib/forms/index.js +25 -0
  189. package/lib/forms/index.js.map +1 -0
  190. package/lib/forms/register.helpers.d.ts +6 -0
  191. package/lib/forms/register.helpers.js +96 -0
  192. package/lib/forms/register.helpers.js.map +1 -0
  193. package/lib/forms/studio/api.helpers.d.ts +37 -0
  194. package/lib/forms/studio/api.helpers.js +162 -0
  195. package/lib/forms/studio/api.helpers.js.map +1 -0
  196. package/lib/forms/studio/display.helpers.d.ts +7 -0
  197. package/lib/forms/studio/display.helpers.js +256 -0
  198. package/lib/forms/studio/display.helpers.js.map +1 -0
  199. package/lib/forms/studio/index.d.ts +2 -0
  200. package/lib/forms/studio/index.js +20 -0
  201. package/lib/forms/studio/index.js.map +1 -0
  202. package/lib/forms/types.d.ts +100 -0
  203. package/lib/forms/types.js +19 -0
  204. package/lib/forms/types.js.map +1 -0
  205. package/lib/forms/validation.helpers.d.ts +10 -0
  206. package/lib/forms/validation.helpers.js +234 -0
  207. package/lib/forms/validation.helpers.js.map +1 -0
  208. package/lib/header/hooks.d.ts +29 -1
  209. package/lib/header/hooks.js +83 -2
  210. package/lib/header/hooks.js.map +1 -1
  211. package/lib/header/types.d.ts +2 -0
  212. package/lib/hooks/use-navigation.d.ts +1 -0
  213. package/lib/hooks/use-navigation.js +4 -1
  214. package/lib/hooks/use-navigation.js.map +1 -1
  215. package/lib/i18n/component/Translator.d.ts +1 -1
  216. package/lib/i18n/hooks/use-translator.js +3 -1
  217. package/lib/i18n/hooks/use-translator.js.map +1 -1
  218. package/lib/i18n/translations/en.json +53 -1
  219. package/lib/i18n/translations/fr.json +53 -1
  220. package/lib/index.d.ts +4 -3
  221. package/lib/index.js +4 -3
  222. package/lib/index.js.map +1 -1
  223. package/lib/models/index.d.ts +2 -0
  224. package/lib/models/index.js +2 -0
  225. package/lib/models/index.js.map +1 -1
  226. package/lib/models/objectFields.js +3 -0
  227. package/lib/models/objectFields.js.map +1 -1
  228. package/lib/models/searchFields.d.ts +2 -0
  229. package/lib/{sessions/components/buttons/LoginButton.js → models/searchFields.js} +3 -6
  230. package/lib/models/searchFields.js.map +1 -0
  231. package/lib/models/sortFields.d.ts +2 -0
  232. package/lib/{sessions/components/buttons/UpdateButton.js → models/sortFields.js} +3 -6
  233. package/lib/models/sortFields.js.map +1 -0
  234. package/lib/navigator/Navigator.d.ts +1 -1
  235. package/lib/navigator/Navigator.js +2 -18
  236. package/lib/navigator/Navigator.js.map +1 -1
  237. package/lib/navigator/drawer/Header.js +1 -1
  238. package/lib/navigator/drawer/Header.js.map +1 -1
  239. package/lib/redux/store.d.ts +1 -1
  240. package/lib/screens/BarcodeDisplayScreen.d.ts +4 -0
  241. package/lib/screens/BarcodeDisplayScreen.js +54 -0
  242. package/lib/screens/BarcodeDisplayScreen.js.map +1 -0
  243. package/lib/screens/ErrorScreen.js +1 -1
  244. package/lib/screens/ErrorScreen.js.map +1 -1
  245. package/lib/screens/JsonFieldScreen.d.ts +4 -0
  246. package/lib/screens/JsonFieldScreen.js +92 -0
  247. package/lib/screens/JsonFieldScreen.js.map +1 -0
  248. package/lib/screens/SessionManagementScreen.js +1 -1
  249. package/lib/screens/SessionManagementScreen.js.map +1 -1
  250. package/lib/screens/index.d.ts +51 -0
  251. package/lib/screens/index.js +56 -0
  252. package/lib/screens/index.js.map +1 -0
  253. package/lib/sessions/components/alerts/PopupCreateSession.d.ts +3 -3
  254. package/lib/sessions/components/alerts/PopupCreateSession.js +30 -29
  255. package/lib/sessions/components/alerts/PopupCreateSession.js.map +1 -1
  256. package/lib/sessions/components/alerts/PopupEditSession.js +9 -16
  257. package/lib/sessions/components/alerts/PopupEditSession.js.map +1 -1
  258. package/lib/sessions/components/alerts/PopupSession.js +7 -16
  259. package/lib/sessions/components/alerts/PopupSession.js.map +1 -1
  260. package/lib/sessions/components/display/SessionListCard.js +3 -6
  261. package/lib/sessions/components/display/SessionListCard.js.map +1 -1
  262. package/lib/sessions/components/index.d.ts +0 -1
  263. package/lib/sessions/components/index.js +0 -1
  264. package/lib/sessions/components/index.js.map +1 -1
  265. package/lib/sessions/components/inputs/SessionInputs.d.ts +2 -1
  266. package/lib/sessions/components/inputs/SessionInputs.js +18 -13
  267. package/lib/sessions/components/inputs/SessionInputs.js.map +1 -1
  268. package/lib/tools/LinkingProvider.d.ts +2 -2
  269. package/lib/tools/LinkingProvider.js +4 -4
  270. package/lib/tools/LinkingProvider.js.map +1 -1
  271. package/lib/types/anomaly-type.d.ts +16 -0
  272. package/lib/types/anomaly-type.js +56 -0
  273. package/lib/types/anomaly-type.js.map +1 -0
  274. package/lib/types/index.d.ts +1 -0
  275. package/lib/types/index.js +1 -0
  276. package/lib/types/index.js.map +1 -1
  277. package/lib/utils/displayers.d.ts +1 -0
  278. package/lib/utils/displayers.js +1 -0
  279. package/lib/utils/displayers.js.map +1 -1
  280. package/lib/utils/filter.d.ts +4 -0
  281. package/lib/utils/filter.js +13 -0
  282. package/lib/utils/filter.js.map +1 -1
  283. package/lib/utils/formatters.d.ts +1 -0
  284. package/lib/utils/formatters.js +16 -0
  285. package/lib/utils/formatters.js.map +1 -1
  286. package/lib/utils/index.d.ts +3 -3
  287. package/lib/utils/index.js +3 -3
  288. package/lib/utils/index.js.map +1 -1
  289. package/package.json +7 -8
  290. package/lib/sessions/components/buttons/DisabledButton.d.ts +0 -7
  291. package/lib/sessions/components/buttons/DisabledButton.js +0 -45
  292. package/lib/sessions/components/buttons/DisabledButton.js.map +0 -1
  293. package/lib/sessions/components/buttons/LoginButton.d.ts +0 -6
  294. package/lib/sessions/components/buttons/LoginButton.js.map +0 -1
  295. package/lib/sessions/components/buttons/UpdateButton.d.ts +0 -6
  296. package/lib/sessions/components/buttons/UpdateButton.js.map +0 -1
  297. package/lib/sessions/components/buttons/index.d.ts +0 -3
  298. package/lib/sessions/components/buttons/index.js.map +0 -1
@@ -11,4 +11,4 @@ export const fetchMenuConfig: import("@reduxjs/toolkit").AsyncThunk<any, void, {
11
11
  export const menuConfigReducer: import("redux").Reducer<{
12
12
  loadingConfig: boolean;
13
13
  restrictedMenus: any[];
14
- }, import("redux").AnyAction>;
14
+ }>;
@@ -0,0 +1,34 @@
1
+ export const fetchJsonFieldsOfModel: import("@reduxjs/toolkit").AsyncThunk<any, void, {
2
+ state?: unknown;
3
+ dispatch?: import("redux").Dispatch<import("redux").AnyAction>;
4
+ extra?: unknown;
5
+ rejectValue?: unknown;
6
+ serializedErrorType?: unknown;
7
+ pendingMeta?: unknown;
8
+ fulfilledMeta?: unknown;
9
+ rejectedMeta?: unknown;
10
+ }>;
11
+ export const fetchObject: import("@reduxjs/toolkit").AsyncThunk<any, void, {
12
+ state?: unknown;
13
+ dispatch?: import("redux").Dispatch<import("redux").AnyAction>;
14
+ extra?: unknown;
15
+ rejectValue?: unknown;
16
+ serializedErrorType?: unknown;
17
+ pendingMeta?: unknown;
18
+ fulfilledMeta?: unknown;
19
+ rejectedMeta?: unknown;
20
+ }>;
21
+ export const updateJsonFieldsObject: import("@reduxjs/toolkit").AsyncThunk<any, void, {
22
+ state?: unknown;
23
+ dispatch?: import("redux").Dispatch<import("redux").AnyAction>;
24
+ extra?: unknown;
25
+ rejectValue?: unknown;
26
+ serializedErrorType?: unknown;
27
+ pendingMeta?: unknown;
28
+ fulfilledMeta?: unknown;
29
+ rejectedMeta?: unknown;
30
+ }>;
31
+ export const metaJsonFieldReducer: import("redux").Reducer<{
32
+ fields: any[];
33
+ object: {};
34
+ }>;
@@ -0,0 +1,68 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2023 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 { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
19
+ import { handlerApiCall } from '../apiProviders/utils';
20
+ import { fetchJsonFieldsOfModel as _fetchJsonFieldsOfModel, fetchObject as _fetchObject, updateJsonFieldsObject as _updateJsonFieldsObject, } from '../forms/studio/api.helpers';
21
+ export const fetchJsonFieldsOfModel = createAsyncThunk('metaJsonField/fetchJsonFieldsOfModel', async function (data, { getState }) {
22
+ return handlerApiCall({
23
+ fetchFunction: _fetchJsonFieldsOfModel,
24
+ data: data,
25
+ action: 'Base_SliceAction_FetchJsonFieldsOfModel',
26
+ getState: getState,
27
+ responseOptions: { isArrayResponse: true, showToast: false },
28
+ });
29
+ });
30
+ export const fetchObject = createAsyncThunk('metaJsonField/fetchObject', async function (data, { getState }) {
31
+ return handlerApiCall({
32
+ fetchFunction: _fetchObject,
33
+ data: data,
34
+ action: 'Base_SliceAction_FetchDataOfModel',
35
+ getState: getState,
36
+ responseOptions: { isArrayResponse: false, showToast: false },
37
+ });
38
+ });
39
+ export const updateJsonFieldsObject = createAsyncThunk('metaJsonField/updateJsonFieldsObject', async function (data, { getState }) {
40
+ return handlerApiCall({
41
+ fetchFunction: _updateJsonFieldsObject,
42
+ data: data,
43
+ action: 'Base_SliceAction_UpdateJsonFieldsObject',
44
+ getState: getState,
45
+ responseOptions: { isArrayResponse: false, showToast: true },
46
+ });
47
+ });
48
+ const initialState = {
49
+ fields: [],
50
+ object: {},
51
+ };
52
+ const metaJsonFieldSlice = createSlice({
53
+ name: 'metaJsonField',
54
+ initialState,
55
+ extraReducers: builder => {
56
+ builder.addCase(fetchJsonFieldsOfModel.fulfilled, (state, action) => {
57
+ state.fields = action.payload;
58
+ });
59
+ builder.addCase(fetchObject.fulfilled, (state, action) => {
60
+ state.object = action.payload;
61
+ });
62
+ builder.addCase(updateJsonFieldsObject.fulfilled, (state, action) => {
63
+ state.object = action.payload;
64
+ });
65
+ },
66
+ });
67
+ export const metaJsonFieldReducer = metaJsonFieldSlice.reducer;
68
+ //# sourceMappingURL=metaJsonFieldSlice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metaJsonFieldSlice.js","sourceRoot":"","sources":["../../src/features/metaJsonFieldSlice.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,gBAAgB,EAAE,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAC,cAAc,EAA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EAAE,EAAE;IACV,MAAM,EAAE,EAAE;CACX,CAAC;AAEF,MAAM,kBAAkB,GAAG,WAAW,CAAC;IACrC,IAAI,EAAE,eAAe;IACrB,YAAY;IACZ,aAAa,EAAE,OAAO,CAAC,EAAE;QACvB,OAAO,CAAC,OAAO,CAAC,sBAAsB,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;YAClE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC;QAChC,CAAC,CAAC,CAAC;QACH,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;YACvD,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC;QAChC,CAAC,CAAC,CAAC;QACH,OAAO,CAAC,OAAO,CAAC,sBAAsB,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;YAClE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC;QAChC,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG,kBAAkB,CAAC,OAAO,CAAC"}
@@ -11,4 +11,4 @@ export const fetchMetaModules: import("@reduxjs/toolkit").AsyncThunk<any, void,
11
11
  export const metaModuleReducer: import("redux").Reducer<{
12
12
  loading: boolean;
13
13
  metaModules: any[];
14
- }, import("redux").AnyAction>;
14
+ }>;
@@ -11,4 +11,4 @@ export const getFileDetails: import("@reduxjs/toolkit").AsyncThunk<any, void, {
11
11
  export const metafileReducer: import("redux").Reducer<{
12
12
  loadingMetafile: boolean;
13
13
  metafile: {};
14
- }, import("redux").AnyAction>;
14
+ }>;
@@ -11,4 +11,4 @@ export const fetchMobileConfig: import("@reduxjs/toolkit").AsyncThunk<any, void,
11
11
  export const mobileConfigReducer: import("redux").Reducer<{
12
12
  loadingConfig: boolean;
13
13
  mobileConfigs: any[];
14
- }, import("redux").AnyAction>;
14
+ }>;
@@ -6,6 +6,6 @@ export declare const onlineSlice: import("@reduxjs/toolkit").Slice<OnlineState,
6
6
  disable: (state: import("immer/dist/internal").WritableDraft<OnlineState>) => void;
7
7
  }, "online">;
8
8
  export declare const disable: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"online/disable">, enable: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"online/enable">;
9
- export declare const onlineReducer: import("redux").Reducer<OnlineState, import("redux").AnyAction>;
9
+ export declare const onlineReducer: import("redux").Reducer<OnlineState>;
10
10
  export declare const useOnline: () => OnlineState;
11
11
  export declare const useEffectOnline: () => void;
@@ -3,12 +3,12 @@ interface ScannerSliceState {
3
3
  scanKey: string | null;
4
4
  scannedValue: string | null;
5
5
  }
6
- export declare const enableScan: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scanner/enableScan">, scanValue: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scanner/scanValue">, disableScan: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"scanner/disableScan">;
6
+ export declare const enableScan: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scanner/enableScan">, scanValue: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "scanner/scanValue">, disableScan: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"scanner/disableScan">, clearScan: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"scanner/clearScan">;
7
7
  export declare const useScannerSelector: () => ScannerSliceState;
8
8
  export declare const useScannedValueByKey: (key: string) => string | null;
9
9
  declare const _default: import("redux").Reducer<{
10
10
  isEnabled: boolean;
11
11
  scanKey: any;
12
12
  scannedValue: any;
13
- }, import("redux").AnyAction>;
13
+ }>;
14
14
  export default _default;
@@ -39,9 +39,12 @@ const scannerSlice = createSlice({
39
39
  state.scanKey = null;
40
40
  state.scannedValue = null;
41
41
  },
42
+ clearScan(state) {
43
+ state.scannedValue = null;
44
+ },
42
45
  },
43
46
  });
44
- export const { enableScan, scanValue, disableScan } = scannerSlice.actions;
47
+ export const { enableScan, scanValue, disableScan, clearScan } = scannerSlice.actions;
45
48
  const selectScanner = state => state.scanner;
46
49
  export const useScannerSelector = () => useSelector(selectScanner);
47
50
  export const useScannedValueByKey = key => {
@@ -1 +1 @@
1
- {"version":3,"file":"scannerSlice.js","sourceRoot":"","sources":["../../src/features/scannerSlice.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAC,WAAW,EAAC,MAAM,aAAa,CAAC;AACxC,OAAO,EAAC,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAQ7C,MAAM,YAAY,GAAG,WAAW,CAAC;IAC/B,IAAI,EAAE,SAAS;IACf,YAAY,EAAE;QACZ,SAAS,EAAE,KAAK;QAChB,OAAO,EAAE,IAAI;QACb,YAAY,EAAE,IAAI;KACnB;IACD,QAAQ,EAAE;QACR,UAAU,CAAC,KAAK,EAAE,MAAM;YACtB,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC;YACvB,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;YAC/B,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC;QAC5B,CAAC;QACD,SAAS,CAAC,KAAK,EAAE,MAAM;YACrB,KAAK,CAAC,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC;QACtC,CAAC;QACD,WAAW,CAAC,KAAK;YACf,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC;YACxB,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC;YACrB,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC;QAC5B,CAAC;KACF;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,EAAC,UAAU,EAAE,SAAS,EAAE,WAAW,EAAC,GAAG,YAAY,CAAC,OAAO,CAAC;AAEzE,MAAM,aAAa,GAAG,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,OA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,GAAG,KAAK,CAAC;YACxB,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC;YACrB,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC;QAC5B,CAAC;QACD,SAAS,CAAC,KAAK;YACb,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC;QAC5B,CAAC;KACF;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,EAAC,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAC,GAC1D,YAAY,CAAC,OAAO,CAAC;AAEvB,MAAM,aAAa,GAAG,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC;AAE7C,MAAM,CAAC,MAAM,kBAAkB,GAA4B,GAAG,EAAE,CAC9D,WAAW,CAAC,aAAa,CAAC,CAAC;AAE7B,MAAM,CAAC,MAAM,oBAAoB,GAAmC,GAAG,CAAC,EAAE;IACxE,MAAM,EAAC,OAAO,EAAE,YAAY,EAAC,GAAG,kBAAkB,EAAE,CAAC;IACrD,OAAO,OAAO,CACZ,GAAG,EAAE,CAAC,CAAC,GAAG,KAAK,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,EAC7C,CAAC,OAAO,EAAE,GAAG,EAAE,YAAY,CAAC,CAC7B,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC,OAAO,CAAC"}
@@ -0,0 +1,16 @@
1
+ export const searchUser: import("@reduxjs/toolkit").AsyncThunk<any, void, {
2
+ state?: unknown;
3
+ dispatch?: import("redux").Dispatch<import("redux").AnyAction>;
4
+ extra?: unknown;
5
+ rejectValue?: unknown;
6
+ serializedErrorType?: unknown;
7
+ pendingMeta?: unknown;
8
+ fulfilledMeta?: unknown;
9
+ rejectedMeta?: unknown;
10
+ }>;
11
+ export const userListReducer: import("redux").Reducer<{
12
+ loadingUser: boolean;
13
+ moreLoading: boolean;
14
+ isListEnd: boolean;
15
+ userList: any[];
16
+ }>;
@@ -0,0 +1,49 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2023 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 { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
19
+ import { generateInifiniteScrollCases, handlerApiCall, } from '../apiProviders/utils';
20
+ import { searchUser as _searchUser } from '../api/user-api';
21
+ export const searchUser = createAsyncThunk('user/searchUser', async function (data, { getState }) {
22
+ return handlerApiCall({
23
+ fetchFunction: _searchUser,
24
+ data,
25
+ action: 'Base_SliceAction_SearchUser',
26
+ getState,
27
+ responseOptions: { isArrayResponse: true },
28
+ });
29
+ });
30
+ const initialState = {
31
+ loadingUser: true,
32
+ moreLoading: false,
33
+ isListEnd: false,
34
+ userList: [],
35
+ };
36
+ const userSlice = createSlice({
37
+ name: 'user',
38
+ initialState,
39
+ extraReducers: builder => {
40
+ generateInifiniteScrollCases(builder, searchUser, {
41
+ loading: 'loadingUser',
42
+ moreLoading: 'moreLoading',
43
+ isListEnd: 'isListEnd',
44
+ list: 'userList',
45
+ });
46
+ },
47
+ });
48
+ export const userListReducer = userSlice.reducer;
49
+ //# sourceMappingURL=userSlice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"userSlice.js","sourceRoot":"","sources":["../../src/features/userSlice.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,gBAAgB,EAAE,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EACL,4BAA4B,EAC5B,cAAc,GACf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAC,UAAU,IAAI,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAE1D,MAAM,CAAC,MAAM,UAAU,GAAG,gBAAgB,CACxC,iBAAiB,EACjB,KAAK,WAAW,IAAI,EAAE,EAAC,QAAQ,EAAC;IAC9B,OAAO,cAAc,CAAC;QACpB,aAAa,EAAE,WAAW;QAC1B,IAAI;QACJ,MAAM,EAAE,6BAA6B;QACrC,QAAQ;QACR,eAAe,EAAE,EAAC,eAAe,EAAE,IAAI,EAAC;KACzC,CAAC,CAAC;AACL,CAAC,CACF,CAAC;AAEF,MAAM,YAAY,GAAG;IACnB,WAAW,EAAE,IAAI;IACjB,WAAW,EAAE,KAAK;IAClB,SAAS,EAAE,KAAK;IAChB,QAAQ,EAAE,EAAE;CACb,CAAC;AAEF,MAAM,SAAS,GAAG,WAAW,CAAC;IAC5B,IAAI,EAAE,MAAM;IACZ,YAAY;IACZ,aAAa,EAAE,OAAO,CAAC,EAAE;QACvB,4BAA4B,CAAC,OAAO,EAAE,UAAU,EAAE;YAChD,OAAO,EAAE,aAAa;YACtB,WAAW,EAAE,aAAa;YAC1B,SAAS,EAAE,WAAW;YACtB,IAAI,EAAE,UAAU;SACjB,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,SAAS,CAAC,OAAO,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { Form, FormConfigs } from './types';
2
+ export interface RegisterOptions {
3
+ replaceOld?: boolean;
4
+ }
5
+ declare class FormConfigsProvider {
6
+ private formConfigs;
7
+ private refreshCallBack;
8
+ constructor();
9
+ register(callBack: any): void;
10
+ init(configs: FormConfigs): void;
11
+ private updateState;
12
+ getFormConfig(key: string): Form;
13
+ registerForm(key: string, options: Form, registerOptions: RegisterOptions): void;
14
+ getAllConfigs(): FormConfigs;
15
+ }
16
+ export declare const formConfigsProvider: FormConfigsProvider;
17
+ export declare const useFormConfig: (modelKey: string) => {
18
+ config: Form;
19
+ };
20
+ export {};
@@ -0,0 +1,56 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2023 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 { useCallback, useEffect, useMemo, useState } from 'react';
19
+ import { addModuleForms, fetchOptionsOfFormKey } from './register.helpers';
20
+ class FormConfigsProvider {
21
+ formConfigs;
22
+ refreshCallBack;
23
+ constructor() {
24
+ this.formConfigs = {};
25
+ this.refreshCallBack = () => { };
26
+ }
27
+ register(callBack) {
28
+ this.refreshCallBack = callBack;
29
+ }
30
+ init(configs) {
31
+ this.formConfigs = configs;
32
+ }
33
+ updateState() {
34
+ this.refreshCallBack(this.formConfigs);
35
+ }
36
+ getFormConfig(key) {
37
+ return fetchOptionsOfFormKey(this.formConfigs, key);
38
+ }
39
+ registerForm(key, options, registerOptions) {
40
+ this.formConfigs = addModuleForms({ ...this.formConfigs }, { [key]: options }, registerOptions);
41
+ this.updateState();
42
+ }
43
+ getAllConfigs() {
44
+ return this.formConfigs;
45
+ }
46
+ }
47
+ export const formConfigsProvider = new FormConfigsProvider();
48
+ export const useFormConfig = (modelKey) => {
49
+ const [forms, setForms] = useState(formConfigsProvider.getAllConfigs());
50
+ useEffect(() => {
51
+ formConfigsProvider.register(setForms);
52
+ }, []);
53
+ const getFormConfigOfModel = useCallback(key => fetchOptionsOfFormKey(forms, key), [forms]);
54
+ return useMemo(() => ({ config: getFormConfigOfModel(modelKey) }), [getFormConfigOfModel, modelKey]);
55
+ };
56
+ //# sourceMappingURL=FormConfigsProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormConfigsProvider.js","sourceRoot":"","sources":["../../src/forms/FormConfigsProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAEhE,OAAO,EAAC,cAAc,EAAE,qBAAqB,EAAC,MAAM,oBAAoB,CAAC;AAMzE,MAAM,mBAAmB;IACf,WAAW,CAAc;IACzB,eAAe,CAAW;IAElC;QACE,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QACtB,IAAI,CAAC,eAAe,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;IAClC,CAAC;IAED,QAAQ,CAAC,QAAQ;QACf,IAAI,CAAC,eAAe,GAAG,QAAQ,CAAC;IAClC,CAAC;IAED,IAAI,CAAC,OAAoB;QACvB,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC;IAC7B,CAAC;IAEO,WAAW;QACjB,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACzC,CAAC;IAED,aAAa,CAAC,GAAW;QACvB,OAAO,qBAAqB,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;IACtD,CAAC;IAED,YAAY,CAAC,GAAW,EAAE,OAAa,EAAE,eAAgC;QACvE,IAAI,CAAC,WAAW,GAAG,cAAc,CAC/B,EAAC,GAAG,IAAI,CAAC,WAAW,EAAC,EACrB,EAAC,CAAC,GAAG,CAAC,EAAE,OAAO,EAAC,EAChB,eAAe,CAChB,CAAC;QAEF,IAAI,CAAC,WAAW,EAAE,CAAC;IACrB,CAAC;IAED,aAAa;QACX,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;CACF;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,mBAAmB,EAAE,CAAC;AAE7D,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,QAAgB,EAAkB,EAAE;IAChE,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,mBAAmB,CAAC,aAAa,EAAE,CAAC,CAAC;IAExE,SAAS,CAAC,GAAG,EAAE;QACb,mBAAmB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACzC,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,oBAAoB,GAAG,WAAW,CACtC,GAAG,CAAC,EAAE,CAAC,qBAAqB,CAAC,KAAK,EAAE,GAAG,CAAC,EACxC,CAAC,KAAK,CAAC,CACR,CAAC;IAEF,OAAO,OAAO,CACZ,GAAG,EAAE,CAAC,CAAC,EAAC,MAAM,EAAE,oBAAoB,CAAC,QAAQ,CAAC,EAAC,CAAC,EAChD,CAAC,oBAAoB,EAAE,QAAQ,CAAC,CACjC,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ export declare function createRecord({ modelName, data, }: {
2
+ modelName: string;
3
+ data: any;
4
+ }): Promise<void>;
5
+ export declare function updateRecord({ modelName, data, }: {
6
+ modelName: string;
7
+ data: any;
8
+ }): Promise<void>;
9
+ export declare function refreshRecord({ modelName, id, }: {
10
+ modelName: string;
11
+ id: number;
12
+ }): Promise<import("../apiProviders").RequestResponse>;
@@ -0,0 +1,59 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2023 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 { getActionApi, getModelApi } from '../apiProviders';
19
+ const getMatcherFields = (data) => {
20
+ const fields = {};
21
+ Object.keys(data).forEach(key => {
22
+ fields[`data.${key}`] = key;
23
+ });
24
+ return fields;
25
+ };
26
+ export async function createRecord({ modelName, data, }) {
27
+ return getActionApi().send({
28
+ method: 'put',
29
+ url: `ws/rest/${modelName}`,
30
+ body: {
31
+ data,
32
+ },
33
+ description: `create new ${modelName}`,
34
+ matchers: {
35
+ modelName,
36
+ id: Date.now(),
37
+ fields: getMatcherFields(data),
38
+ },
39
+ });
40
+ }
41
+ export async function updateRecord({ modelName, data, }) {
42
+ return getActionApi().send({
43
+ method: 'post',
44
+ url: `ws/rest/${modelName}/${data?.id}`,
45
+ body: {
46
+ data,
47
+ },
48
+ description: `update ${modelName} with id ${data?.id}`,
49
+ matchers: {
50
+ modelName,
51
+ id: data?.id,
52
+ fields: getMatcherFields(data),
53
+ },
54
+ });
55
+ }
56
+ export async function refreshRecord({ modelName, id, }) {
57
+ return getModelApi().get({ modelName, id });
58
+ }
59
+ //# sourceMappingURL=api.helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.helpers.js","sourceRoot":"","sources":["../../src/forms/api.helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAe,YAAY,EAAE,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAExE,MAAM,gBAAgB,GAAG,CAAC,IAAS,EAAgB,EAAE;IACnD,MAAM,MAAM,GAAG,EAAE,CAAC;IAElB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;QAC9B,MAAM,CAAC,QAAQ,GAAG,EAAE,CAAC,GAAG,GAAG,CAAC;IAC9B,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,EACjC,SAAS,EACT,IAAI,GAIL;IACC,OAAO,YAAY,EAAE,CAAC,IAAI,CAAC;QACzB,MAAM,EAAE,KAAK;QACb,GAAG,EAAE,WAAW,SAAS,EAAE;QAC3B,IAAI,EAAE;YACJ,IAAI;SACL;QACD,WAAW,EAAE,cAAc,SAAS,EAAE;QACtC,QAAQ,EAAE;YACR,SAAS;YACT,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE;YACd,MAAM,EAAE,gBAAgB,CAAC,IAAI,CAAC;SAC/B;KACF,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,EACjC,SAAS,EACT,IAAI,GAIL;IACC,OAAO,YAAY,EAAE,CAAC,IAAI,CAAC;QACzB,MAAM,EAAE,MAAM;QACd,GAAG,EAAE,WAAW,SAAS,IAAI,IAAI,EAAE,EAAE,EAAE;QACvC,IAAI,EAAE;YACJ,IAAI;SACL;QACD,WAAW,EAAE,UAAU,SAAS,YAAY,IAAI,EAAE,EAAE,EAAE;QACtD,QAAQ,EAAE;YACR,SAAS;YACT,EAAE,EAAE,IAAI,EAAE,EAAE;YACZ,MAAM,EAAE,gBAAgB,CAAC,IAAI,CAAC;SAC/B;KACF,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,EAClC,SAAS,EACT,EAAE,GAIH;IACC,OAAO,WAAW,EAAE,CAAC,GAAG,CAAC,EAAC,SAAS,EAAE,EAAE,EAAC,CAAC,CAAC;AAC5C,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { KeyboardType } from 'react-native';
2
+ import { Action, DisplayField, DisplayPanel, Form, Widget } from './types';
3
+ export declare const isField: (_object: DisplayPanel | DisplayField) => boolean;
4
+ export declare const getFields: (config: Form) => DisplayField[];
5
+ export declare const getPanels: (config: Form) => DisplayPanel[];
6
+ export declare const sortContent: (config: Form) => (DisplayPanel | DisplayField)[];
7
+ export declare const getWidget: (_field: DisplayField) => Widget;
8
+ export declare const getKeyboardType: (_field: DisplayField) => KeyboardType;
9
+ export declare const getButtonTitleKey: (_action: Action) => string;
@@ -0,0 +1,150 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2023 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 { checkNullString } from '@axelor/aos-mobile-ui';
19
+ import { DEFAULT_COLSPAN, } from './types';
20
+ export const isField = (_object) => {
21
+ return _object.type != null;
22
+ };
23
+ export const getFields = (config) => {
24
+ return Object.entries(config.fields)
25
+ .map(([fieldName, _field], index) => ({
26
+ ..._field,
27
+ key: fieldName,
28
+ order: _field.order != null ? _field.order : index * 10,
29
+ hideIf: _field.hideIf != null ? _field.hideIf : () => false,
30
+ requiredIf: _field.requiredIf != null ? _field.requiredIf : () => false,
31
+ readonlyIf: _field.readonlyIf != null ? _field.readonlyIf : () => false,
32
+ }))
33
+ .sort((a, b) => a.order - b.order);
34
+ };
35
+ export const getPanels = (config) => {
36
+ return Object.entries(config.panels)
37
+ .map(([panelKey, _panel], index) => ({
38
+ ..._panel,
39
+ key: panelKey,
40
+ order: _panel.order != null ? _panel.order : index * 10,
41
+ }))
42
+ .sort((a, b) => a.order - b.order);
43
+ };
44
+ export const sortContent = (config) => {
45
+ if (config == null) {
46
+ return [];
47
+ }
48
+ const fields = getFields(config);
49
+ if (config.panels == null || Object.keys(config.panels).length === 0) {
50
+ return fields;
51
+ }
52
+ const panels = getPanels(config);
53
+ const rootPanels = panels.filter(_item => checkNullString(_item.parent));
54
+ if (rootPanels.length === 0) {
55
+ return fields;
56
+ }
57
+ const result = fields.filter(_item => checkNullString(_item.parentPanel));
58
+ rootPanels.forEach(_panel => {
59
+ result.push({
60
+ ..._panel,
61
+ content: getContentOfPanel(_panel.key, fields, panels),
62
+ });
63
+ });
64
+ return result.sort((a, b) => a.order - b.order);
65
+ };
66
+ const getContentOfPanel = (panelKey, fields, panels) => {
67
+ if (fields.length === 0) {
68
+ return [];
69
+ }
70
+ let result = fields.filter(_item => _item.parentPanel === panelKey);
71
+ if (panels.length === 0) {
72
+ return result;
73
+ }
74
+ panels
75
+ .filter(_item => _item.parent === panelKey)
76
+ .forEach(_item => {
77
+ result.push({
78
+ colSpan: DEFAULT_COLSPAN,
79
+ ..._item,
80
+ content: getContentOfPanel(_item.key, fields.filter(_field => _field.parentPanel !== panelKey), panels.filter(_panel => _panel.parent !== panelKey)),
81
+ });
82
+ });
83
+ return result.sort((a, b) => a.order - b.order);
84
+ };
85
+ export const getWidget = (_field) => {
86
+ if (_field.widget === 'custom' && _field.customComponent != null) {
87
+ return 'custom';
88
+ }
89
+ if (_field.widget === 'file') {
90
+ return 'file';
91
+ }
92
+ if (_field.widget === 'label' && _field.type === 'string') {
93
+ return 'label';
94
+ }
95
+ if (_field.type === 'boolean') {
96
+ return 'checkbox';
97
+ }
98
+ if (_field.widget === 'star' && _field.type === 'number') {
99
+ return 'star';
100
+ }
101
+ if (_field.widget === 'increment' || _field.type === 'number') {
102
+ return 'increment';
103
+ }
104
+ if (_field.type === 'date' ||
105
+ _field.type === 'datetime' ||
106
+ _field.type === 'time') {
107
+ return 'date';
108
+ }
109
+ if (_field.widget === 'password' && _field.type === 'string') {
110
+ return 'password';
111
+ }
112
+ if (_field.widget === 'HTML' && _field.type === 'string') {
113
+ return 'HTML';
114
+ }
115
+ return 'default';
116
+ };
117
+ export const getKeyboardType = (_field) => {
118
+ switch (_field.type) {
119
+ case 'number':
120
+ if (_field.validationOptions != null &&
121
+ Object.keys(_field.validationOptions).includes('integer')) {
122
+ return 'number-pad';
123
+ }
124
+ return 'decimal-pad';
125
+ case 'phone':
126
+ return 'phone-pad';
127
+ case 'email':
128
+ return 'email-address';
129
+ default:
130
+ return 'default';
131
+ }
132
+ };
133
+ export const getButtonTitleKey = (_action) => {
134
+ if (_action.titleKey != null) {
135
+ return _action.titleKey;
136
+ }
137
+ switch (_action.type) {
138
+ case 'create':
139
+ return 'Base_FormAction_Create';
140
+ case 'update':
141
+ return 'Base_FormAction_Update';
142
+ case 'refresh':
143
+ return 'Base_FormAction_Refresh';
144
+ case 'reset':
145
+ return 'Base_FormAction_Reset';
146
+ default:
147
+ return 'Base_FormAction_Save';
148
+ }
149
+ };
150
+ //# sourceMappingURL=display.helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"display.helpers.js","sourceRoot":"","sources":["../../src/forms/display.helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAC,eAAe,EAAC,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAEL,eAAe,GAKhB,MAAM,SAAS,CAAC;AAEjB,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,OAAoC,EAAW,EAAE;IACvE,OAAQ,OAAe,CAAC,IAAI,IAAI,IAAI,CAAC;AACvC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,MAAY,EAAkB,EAAE;IACxD,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC;SACjC,GAAG,CAAC,CAAC,CAAC,SAAS,EAAE,MAAM,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;QACpC,GAAG,MAAM;QACT,GAAG,EAAE,SAAS;QACd,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,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AClC,KAAK,SAAS;YACZ,OAAO,yBAAyB,CAAC;QACnC,KAAK,OAAO;YACV,OAAO,uBAAuB,CAAC;QACjC;YACE,OAAO,sBAAsB,CAAC;KACjC;AACH,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ export * from './studio';
2
+ export * from './api.helpers';
3
+ export * from './display.helpers';
4
+ export * from './FormConfigsProvider';
5
+ export * from './register.helpers';
6
+ export * from './types';
7
+ export * from './validation.helpers';
@@ -0,0 +1,25 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2023 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 './studio';
19
+ export * from './api.helpers';
20
+ export * from './display.helpers';
21
+ export * from './FormConfigsProvider';
22
+ export * from './register.helpers';
23
+ export * from './types';
24
+ export * from './validation.helpers';
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/forms/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,SAAS,CAAC;AACxB,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { Field, Form, FormConfigs, JSONObject, Panel } from './types';
2
+ import { RegisterOptions } from './FormConfigsProvider';
3
+ export declare const mergePanels: (currentPanels: JSONObject<Panel>, newPanels: JSONObject<Panel>) => JSONObject<Panel>;
4
+ export declare const mergeFields: (currentFields: JSONObject<Field>, newFields: JSONObject<Field>) => JSONObject<Field>;
5
+ export declare const addModuleForms: (forms: FormConfigs, _moduleForms: FormConfigs, registerOptions?: RegisterOptions) => FormConfigs;
6
+ export declare const fetchOptionsOfFormKey: (forms: FormConfigs, key: string) => Form;