@axelor/aos-mobile-core 6.5.0 → 6.5.2

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 (167) hide show
  1. package/lib/api/login-api.d.ts +2 -0
  2. package/lib/api/login-api.js +4 -2
  3. package/lib/api/login-api.js.map +1 -1
  4. package/lib/api/metafile-api.d.ts +6 -0
  5. package/lib/api/metafile-api.js +33 -0
  6. package/lib/api/metafile-api.js.map +1 -1
  7. package/lib/apiProviders/index.d.ts +1 -0
  8. package/lib/apiProviders/index.js +1 -0
  9. package/lib/apiProviders/index.js.map +1 -1
  10. package/lib/apiProviders/middlewares/index.d.ts +1 -0
  11. package/lib/apiProviders/middlewares/index.js +19 -0
  12. package/lib/apiProviders/middlewares/index.js.map +1 -0
  13. package/lib/apiProviders/middlewares/translation.d.ts +2 -0
  14. package/lib/apiProviders/middlewares/translation.js +48 -0
  15. package/lib/apiProviders/middlewares/translation.js.map +1 -0
  16. package/lib/apiProviders/utils.js +8 -9
  17. package/lib/apiProviders/utils.js.map +1 -1
  18. package/lib/app/Module.d.ts +2 -0
  19. package/lib/app/RootNavigator.js +8 -1
  20. package/lib/app/RootNavigator.js.map +1 -1
  21. package/lib/auth/api/config-api.d.ts +1 -5
  22. package/lib/auth/api/config-api.js +1 -10
  23. package/lib/auth/api/config-api.js.map +1 -1
  24. package/lib/auth/features/companySlice.js +1 -1
  25. package/lib/auth/features/companySlice.js.map +1 -1
  26. package/lib/auth/features/configSlice.js +2 -2
  27. package/lib/auth/features/configSlice.js.map +1 -1
  28. package/lib/auth/features/languageSlice.js +1 -1
  29. package/lib/auth/features/languageSlice.js.map +1 -1
  30. package/lib/auth/features/userSlice.js +2 -2
  31. package/lib/auth/features/userSlice.js.map +1 -1
  32. package/lib/auth/hooks/use-auth-headers.d.ts +1 -0
  33. package/lib/auth/hooks/use-auth-headers.js +48 -0
  34. package/lib/auth/hooks/use-auth-headers.js.map +1 -0
  35. package/lib/auth/i18n/en.json +7 -1
  36. package/lib/auth/i18n/fr.json +7 -1
  37. package/lib/auth/index.js +3 -0
  38. package/lib/auth/index.js.map +1 -1
  39. package/lib/auth/screens/SettingsScreen.js +13 -2
  40. package/lib/auth/screens/SettingsScreen.js.map +1 -1
  41. package/lib/auth/screens/UserScreen.js +0 -6
  42. package/lib/auth/screens/UserScreen.js.map +1 -1
  43. package/lib/components/external/Scanner/Scanner.js +10 -6
  44. package/lib/components/external/Scanner/Scanner.js.map +1 -1
  45. package/lib/components/molecules/ErrorText/ErrorText.d.ts +2 -2
  46. package/lib/components/molecules/ErrorText/ErrorText.js +28 -11
  47. package/lib/components/molecules/ErrorText/ErrorText.js.map +1 -1
  48. package/lib/components/molecules/HeaderOptionsMenuItem/HeaderOptionMenuItem.d.ts +2 -1
  49. package/lib/components/molecules/HeaderOptionsMenuItem/HeaderOptionMenuItem.js +9 -9
  50. package/lib/components/molecules/HeaderOptionsMenuItem/HeaderOptionMenuItem.js.map +1 -1
  51. package/lib/components/molecules/InputBarCodeCard/InputBarCodeCard.d.ts +3 -1
  52. package/lib/components/molecules/InputBarCodeCard/InputBarCodeCard.js +18 -33
  53. package/lib/components/molecules/InputBarCodeCard/InputBarCodeCard.js.map +1 -1
  54. package/lib/components/molecules/LoginButton/LoginButton.d.ts +2 -1
  55. package/lib/components/molecules/LoginButton/LoginButton.js +4 -3
  56. package/lib/components/molecules/LoginButton/LoginButton.js.map +1 -1
  57. package/lib/components/molecules/MailMessageReadIcon/MailMessageReadIcon.d.ts +4 -0
  58. package/lib/components/molecules/MailMessageReadIcon/MailMessageReadIcon.js +10 -6
  59. package/lib/components/molecules/MailMessageReadIcon/MailMessageReadIcon.js.map +1 -1
  60. package/lib/components/molecules/UploadFileInput/UploadFileInput.d.ts +6 -0
  61. package/lib/components/molecules/UploadFileInput/UploadFileInput.js +71 -0
  62. package/lib/components/molecules/UploadFileInput/UploadFileInput.js.map +1 -0
  63. package/lib/components/molecules/index.d.ts +1 -1
  64. package/lib/components/molecules/index.js +1 -1
  65. package/lib/components/molecules/index.js.map +1 -1
  66. package/lib/components/organisms/DateInput/DateInput.js +4 -0
  67. package/lib/components/organisms/DateInput/DateInput.js.map +1 -1
  68. package/lib/components/organisms/HeaderOptionsMenu/HeaderOptionsMenu.d.ts +2 -3
  69. package/lib/components/organisms/HeaderOptionsMenu/HeaderOptionsMenu.js +31 -36
  70. package/lib/components/organisms/HeaderOptionsMenu/HeaderOptionsMenu.js.map +1 -1
  71. package/lib/components/organisms/MailMessageCard/MailMessageCard.d.ts +1 -2
  72. package/lib/components/organisms/MailMessageCard/MailMessageCard.js +2 -2
  73. package/lib/components/organisms/MailMessageCard/MailMessageCard.js.map +1 -1
  74. package/lib/components/organisms/MailMessageCommentCard/MailMessageCommentCard.d.ts +1 -1
  75. package/lib/components/organisms/MailMessageCommentCard/MailMessageCommentCard.js +3 -1
  76. package/lib/components/organisms/MailMessageCommentCard/MailMessageCommentCard.js.map +1 -1
  77. package/lib/components/organisms/PasswordInput/PasswordInput.js +1 -1
  78. package/lib/components/organisms/PasswordInput/PasswordInput.js.map +1 -1
  79. package/lib/components/organisms/ScannerAutocompleteSearch/ScannerAutocompleteSearch.d.ts +2 -1
  80. package/lib/components/organisms/ScannerAutocompleteSearch/ScannerAutocompleteSearch.js +18 -13
  81. package/lib/components/organisms/ScannerAutocompleteSearch/ScannerAutocompleteSearch.js.map +1 -1
  82. package/lib/components/organisms/UrlInput/UrlInput.js +1 -1
  83. package/lib/components/organisms/UrlInput/UrlInput.js.map +1 -1
  84. package/lib/components/organisms/UsernameInput/UsernameInput.js +1 -1
  85. package/lib/components/organisms/UsernameInput/UsernameInput.js.map +1 -1
  86. package/lib/components/templates/AttachedFilesView/AttachedFilesView.d.ts +1 -2
  87. package/lib/components/templates/AttachedFilesView/AttachedFilesView.js +4 -2
  88. package/lib/components/templates/AttachedFilesView/AttachedFilesView.js.map +1 -1
  89. package/lib/components/templates/MailMessageView/MailMessageView.d.ts +1 -2
  90. package/lib/components/templates/MailMessageView/MailMessageView.js +38 -24
  91. package/lib/components/templates/MailMessageView/MailMessageView.js.map +1 -1
  92. package/lib/features/attachedFilesSlice.js +3 -3
  93. package/lib/features/attachedFilesSlice.js.map +1 -1
  94. package/lib/features/authSlice.d.ts +31 -24
  95. package/lib/features/authSlice.js +38 -10
  96. package/lib/features/authSlice.js.map +1 -1
  97. package/lib/features/mailMessageSlice.js +10 -10
  98. package/lib/features/mailMessageSlice.js.map +1 -1
  99. package/lib/features/menuConfigSlice.js +1 -1
  100. package/lib/features/menuConfigSlice.js.map +1 -1
  101. package/lib/features/metafileSlice.js +1 -1
  102. package/lib/features/metafileSlice.js.map +1 -1
  103. package/lib/features/mobileConfigSlice.js +1 -1
  104. package/lib/features/mobileConfigSlice.js.map +1 -1
  105. package/lib/header/HeaderActionsProvider.d.ts +15 -0
  106. package/lib/header/HeaderActionsProvider.js +60 -0
  107. package/lib/header/HeaderActionsProvider.js.map +1 -0
  108. package/lib/header/hooks.d.ts +37 -0
  109. package/lib/header/hooks.js +105 -0
  110. package/lib/header/hooks.js.map +1 -0
  111. package/lib/header/index.d.ts +3 -0
  112. package/lib/header/index.js +20 -0
  113. package/lib/header/index.js.map +1 -0
  114. package/lib/header/types.d.ts +22 -0
  115. package/lib/header/types.js +19 -0
  116. package/lib/header/types.js.map +1 -0
  117. package/lib/header/utils.d.ts +3 -0
  118. package/lib/header/utils.js +51 -0
  119. package/lib/header/utils.js.map +1 -0
  120. package/lib/hooks/use-header-registers.d.ts +1 -0
  121. package/lib/{components/molecules/IconSettings/IconSettings.js → hooks/use-header-registers.js} +3 -13
  122. package/lib/hooks/use-header-registers.js.map +1 -0
  123. package/lib/hooks/use-navigation.d.ts +1 -0
  124. package/lib/hooks/use-navigation.js +22 -0
  125. package/lib/hooks/use-navigation.js.map +1 -0
  126. package/lib/hooks/use-scan-activator.d.ts +9 -0
  127. package/lib/hooks/use-scan-activator.js +60 -0
  128. package/lib/hooks/use-scan-activator.js.map +1 -0
  129. package/lib/i18n/component/Translator.d.ts +3 -1
  130. package/lib/i18n/translations/en.json +25 -1
  131. package/lib/i18n/translations/fr.json +25 -1
  132. package/lib/index.d.ts +3 -0
  133. package/lib/index.js +3 -0
  134. package/lib/index.js.map +1 -1
  135. package/lib/navigator/Navigator.js +12 -35
  136. package/lib/navigator/Navigator.js.map +1 -1
  137. package/lib/navigator/drawer/Header.d.ts +7 -0
  138. package/lib/navigator/drawer/Header.js +71 -0
  139. package/lib/navigator/drawer/Header.js.map +1 -0
  140. package/lib/screens/AttachedFilesScreen.d.ts +1 -2
  141. package/lib/screens/AttachedFilesScreen.js +2 -2
  142. package/lib/screens/AttachedFilesScreen.js.map +1 -1
  143. package/lib/screens/LoginScreen.js +21 -10
  144. package/lib/screens/LoginScreen.js.map +1 -1
  145. package/lib/screens/MailMessageScreen.d.ts +1 -2
  146. package/lib/screens/MailMessageScreen.js +2 -2
  147. package/lib/screens/MailMessageScreen.js.map +1 -1
  148. package/lib/utils/api.d.ts +2 -0
  149. package/lib/utils/api.js +47 -0
  150. package/lib/utils/api.js.map +1 -0
  151. package/lib/utils/formatters.js +16 -0
  152. package/lib/utils/formatters.js.map +1 -1
  153. package/lib/utils/index.d.ts +1 -1
  154. package/lib/utils/index.js +1 -1
  155. package/lib/utils/index.js.map +1 -1
  156. package/lib/utils/object.d.ts +1 -0
  157. package/lib/utils/object.js +4 -2
  158. package/lib/utils/object.js.map +1 -1
  159. package/lib/utils/storage-keys.d.ts +1 -0
  160. package/lib/utils/storage-keys.js +19 -0
  161. package/lib/utils/storage-keys.js.map +1 -0
  162. package/lib/utils/string.d.ts +1 -1
  163. package/lib/utils/string.js +1 -1
  164. package/lib/utils/string.js.map +1 -1
  165. package/package.json +7 -5
  166. package/lib/components/molecules/IconSettings/IconSettings.d.ts +0 -4
  167. package/lib/components/molecules/IconSettings/IconSettings.js.map +0 -1
@@ -0,0 +1,105 @@
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 { useNavigation } from '@react-navigation/native';
19
+ import { useCallback, useEffect, useMemo, useState } from 'react';
20
+ import { useDispatch, useSelector } from 'react-redux';
21
+ import { countAttachmentFiles } from '../features/attachedFilesSlice';
22
+ import { countUnreadMailMessages } from '../features/mailMessageSlice';
23
+ import { useTranslator } from '../i18n';
24
+ import { checkNullString } from '../utils';
25
+ export const useBasicActions = ({ model, modelId, disableMailMessages, attachedFileScreenTitle, }) => {
26
+ const navigation = useNavigation();
27
+ const I18n = useTranslator();
28
+ const dispatch = useDispatch();
29
+ const { attachments } = useSelector(state => state.attachedFiles);
30
+ const { unreadMessages } = useSelector(state => state.mailMessages);
31
+ const [disableAttachementFiles, setDisableAttachementFiles] = useState(true);
32
+ const modelConfigured = useMemo(() => !checkNullString(model) && modelId != null, [model, modelId]);
33
+ const countUnreadMessagesAPI = useCallback(() => {
34
+ if (modelConfigured) {
35
+ dispatch(countUnreadMailMessages({ model, modelId }));
36
+ }
37
+ }, [dispatch, model, modelConfigured, modelId]);
38
+ const countAttachmentsAPI = useCallback(() => {
39
+ if (modelConfigured) {
40
+ dispatch(countAttachmentFiles({ model, modelId }));
41
+ }
42
+ }, [dispatch, model, modelConfigured, modelId]);
43
+ useEffect(() => {
44
+ countUnreadMessagesAPI();
45
+ }, [countUnreadMessagesAPI]);
46
+ useEffect(() => {
47
+ countAttachmentsAPI();
48
+ }, [countAttachmentsAPI]);
49
+ useEffect(() => {
50
+ setDisableAttachementFiles(attachments === 0);
51
+ }, [attachments]);
52
+ const mailMessagesAction = useMemo(() => {
53
+ return {
54
+ key: 'mailMessages',
55
+ order: 20,
56
+ onPress: () => navigation.navigate('MailMessageScreen', {
57
+ model,
58
+ modelId,
59
+ }),
60
+ hideIf: disableMailMessages,
61
+ indicator: unreadMessages,
62
+ iconName: 'bell',
63
+ FontAwesome5: false,
64
+ title: I18n.t('Base_MailMessages'),
65
+ showInHeader: true,
66
+ };
67
+ }, [I18n, disableMailMessages, model, modelId, navigation, unreadMessages]);
68
+ const attachedFilesAction = useMemo(() => {
69
+ return {
70
+ key: 'attachedFiles',
71
+ order: 10,
72
+ title: I18n.t('Base_AttachedFiles'),
73
+ iconName: 'paperclip',
74
+ indicator: attachments,
75
+ hideIf: disableAttachementFiles,
76
+ onPress: () => navigation.navigate('AttachedFilesScreen', {
77
+ model,
78
+ modelId,
79
+ screenTitle: attachedFileScreenTitle,
80
+ }),
81
+ showInHeader: true,
82
+ };
83
+ }, [
84
+ I18n,
85
+ attachedFileScreenTitle,
86
+ attachments,
87
+ disableAttachementFiles,
88
+ model,
89
+ modelId,
90
+ navigation,
91
+ ]);
92
+ return useMemo(() => {
93
+ if (modelConfigured) {
94
+ return {
95
+ mailMessagesAction,
96
+ attachedFilesAction,
97
+ };
98
+ }
99
+ return {
100
+ mailMessagesAction: { key: 'mailMessages', hideIf: true },
101
+ attachedFilesAction: { key: 'attachedFiles', hideIf: true },
102
+ };
103
+ }, [attachedFilesAction, mailMessagesAction, modelConfigured]);
104
+ };
105
+ //# sourceMappingURL=hooks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../src/header/hooks.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,aAAa,EAAC,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAC,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AACh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,oBAAoB,CAAC;YACnC,QAAQ,EAAE,WAAW;YACrB,SAAS,EAAE,WAAW;YACtB,MAAM,EAAE,uBAAuB;YAC/B,OAAO,EAAE,GAAG,EAAE,CACZ,UAAU,CAAC,QAAQ,CAAC,qBAAqB,EAAE;gBACzC,KAAK;gBACL,OAAO;gBACP,WAAW,EAAE,uBAAuB;aACrC,CAAC;YACJ,YAAY,EAAE,IAAI;SACnB,CAAC;IACJ,CAAC,EAAE;QACD,IAAI;QACJ,uBAAuB;QACvB,WAAW;QACX,uBAAuB;QACvB,KAAK;QACL,OAAO;QACP,UAAU;KACX,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC,GAAG,EAAE;QAClB,IAAI,eAAe,EAAE;YACnB,OAAO;gBACL,kBAAkB;gBAClB,mBAAmB;aACpB,CAAC;SACH;QAED,OAAO;YACL,kBAAkB,EAAE,EAAC,GAAG,EAAE,cAAc,EAAE,MAAM,EAAE,IAAI,EAAC;YACvD,mBAAmB,EAAE,EAAC,GAAG,EAAE,eAAe,EAAE,MAAM,EAAE,IAAI,EAAC;SAC1D,CAAC;IACJ,CAAC,EAAE,CAAC,mBAAmB,EAAE,kBAAkB,EAAE,eAAe,CAAC,CAAC,CAAC;AACjE,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { headerActionsProvider, useHeaderOptions } from './HeaderActionsProvider';
2
+ export { useBasicActions } from './hooks';
3
+ export { HeaderActions, HeaderOptions, ActionType } from './types';
@@ -0,0 +1,20 @@
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 { headerActionsProvider, useHeaderOptions } from './HeaderActionsProvider';
19
+ export { useBasicActions } from './hooks';
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/header/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,qBAAqB,EAAE,gBAAgB,EAAC,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAC,eAAe,EAAC,MAAM,SAAS,CAAC"}
@@ -0,0 +1,22 @@
1
+ export interface HeaderActions {
2
+ [key: string]: HeaderOptions;
3
+ }
4
+ export interface HeaderOptions {
5
+ model?: string;
6
+ modelId?: number;
7
+ disableMailMessages?: boolean;
8
+ attachedFileScreenTitle?: string;
9
+ actions?: ActionType[];
10
+ }
11
+ export interface ActionType {
12
+ key: string;
13
+ order: number;
14
+ title: string;
15
+ iconName: string;
16
+ iconColor?: string;
17
+ FontAwesome5?: boolean;
18
+ indicator?: number;
19
+ hideIf?: boolean;
20
+ onPress: () => void;
21
+ showInHeader?: boolean;
22
+ }
@@ -0,0 +1,19 @@
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 {};
19
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/header/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG"}
@@ -0,0 +1,3 @@
1
+ import { ActionType, HeaderActions, HeaderOptions } from './types';
2
+ export declare const mergeActions: (currentActions: ActionType[], newActions: ActionType[]) => ActionType[];
3
+ export declare const fetchOptionsOfHeaderKey: (headerActions: HeaderActions, key: string) => HeaderOptions;
@@ -0,0 +1,51 @@
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 '../utils';
19
+ export const mergeActions = (currentActions, newActions) => {
20
+ if (!Array.isArray(newActions) || newActions.length === 0) {
21
+ return currentActions;
22
+ }
23
+ if (!Array.isArray(currentActions) || currentActions.length === 0) {
24
+ return newActions;
25
+ }
26
+ const resultActions = [...currentActions];
27
+ newActions.forEach(action => {
28
+ const index = resultActions.findIndex(_current => _current.key === action.key);
29
+ if (index !== -1) {
30
+ resultActions.splice(index, 1);
31
+ }
32
+ resultActions.push(action);
33
+ });
34
+ const actionsWithOrder = resultActions.map((_action, index) => {
35
+ if (_action.order != null) {
36
+ return _action;
37
+ }
38
+ return { ..._action, order: index * 10 };
39
+ });
40
+ return actionsWithOrder.sort((a, b) => a.order - b.order);
41
+ };
42
+ export const fetchOptionsOfHeaderKey = (headerActions = {}, key) => {
43
+ if (checkNullString(key)) {
44
+ return null;
45
+ }
46
+ if (!Object.keys(headerActions).includes(key)) {
47
+ return null;
48
+ }
49
+ return headerActions[key];
50
+ };
51
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/header/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,eAAe,EAAC,MAAM,UAAU,CAAC;AAGzC,MAAM,CAAC,MAAM,YAAY,GAAG,CAC1B,cAA4B,EAC5B,UAAwB,EACxB,EAAE;IACF,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE;QACzD,OAAO,cAAc,CAAC;KACvB;IAED,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE;QACjE,OAAO,UAAU,CAAC;KACnB;IAED,MAAM,aAAa,GAAG,CAAC,GAAG,cAAc,CAAC,CAAC;IAE1C,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QAC1B,MAAM,KAAK,GAAG,aAAa,CAAC,SAAS,CACnC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,GAAG,KAAK,MAAM,CAAC,GAAG,CACxC,CAAC;QACF,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;YAChB,aAAa,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;SAChC;QAED,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;IAEH,MAAM,gBAAgB,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE;QAC5D,IAAI,OAAO,CAAC,KAAK,IAAI,IAAI,EAAE;YACzB,OAAO,OAAO,CAAC;SAChB;QAED,OAAO,EAAC,GAAG,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG,EAAE,EAAC,CAAC;IACzC,CAAC,CAAC,CAAC;IAEH,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;AAC5D,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,gBAA+B,EAAE,EACjC,GAAW,EACI,EAAE;IACjB,IAAI,eAAe,CAAC,GAAG,CAAC,EAAE;QACxB,OAAO,IAAI,CAAC;KACb;IAED,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QAC7C,OAAO,IAAI,CAAC;KACb;IAED,OAAO,aAAa,CAAC,GAAG,CAAC,CAAC;AAC5B,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export function useHeaderRegisters(headerRegisters: any): void;
@@ -15,17 +15,7 @@
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 from 'react';
19
- import { StyleSheet } from 'react-native';
20
- import { Icon, useThemeColor } from '@axelor/aos-mobile-ui';
21
- const IconSettings = ({ onPress }) => {
22
- const Colors = useThemeColor();
23
- return (<Icon name="cog" color={Colors.primaryColor.background} size={24} style={styles.action} touchable={true} onPress={onPress}/>);
18
+ export const useHeaderRegisters = headerRegisters => {
19
+ [...headerRegisters].map(_moduleHook => _moduleHook());
24
20
  };
25
- const styles = StyleSheet.create({
26
- action: {
27
- margin: 15,
28
- },
29
- });
30
- export default IconSettings;
31
- //# sourceMappingURL=IconSettings.js.map
21
+ //# sourceMappingURL=use-header-registers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-header-registers.js","sourceRoot":"","sources":["../../src/hooks/use-header-registers.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,eAAe,CAAC,EAAE;IAClD,CAAC,GAAG,eAAe,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;AACzD,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const useNavigation: () => any;
@@ -0,0 +1,22 @@
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 { useNavigation as useReactNavigation } from '@react-navigation/native';
19
+ export const useNavigation = () => {
20
+ return useReactNavigation();
21
+ };
22
+ //# sourceMappingURL=use-navigation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-navigation.js","sourceRoot":"","sources":["../../src/hooks/use-navigation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,aAAa,IAAI,kBAAkB,EAAC,MAAM,0BAA0B,CAAC;AAE7E,MAAM,CAAC,MAAM,aAAa,GAAG,GAAQ,EAAE;IACrC,OAAO,kBAAkB,EAAE,CAAC;AAC9B,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ export function useScanActivator(scanKeySearch: any): {
2
+ enable: () => void;
3
+ };
4
+ export function useScannerDeviceActivator(scanKeySearch: any): {
5
+ enable: () => void;
6
+ };
7
+ export function useCameraScannerActivator(scanKeySearch: any): {
8
+ enable: () => void;
9
+ };
@@ -0,0 +1,60 @@
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 DeviceInfo from 'react-native-device-info';
20
+ import { enableCameraScanner } from '../features/cameraScannerSlice';
21
+ import { enableScan } from '../features/scannerSlice';
22
+ import { useDispatch } from '../redux/hooks';
23
+ export const useScanActivator = scanKeySearch => {
24
+ const { enable: enableScanner } = useScannerDeviceActivator(scanKeySearch);
25
+ const { enable: enableCamera } = useCameraScannerActivator(scanKeySearch);
26
+ const [isZebraDevice, setDeviceType] = useState(false);
27
+ useEffect(() => {
28
+ DeviceInfo.getManufacturer().then(manufacturer => setDeviceType(manufacturer === 'Zebra Technologies'));
29
+ }, []);
30
+ const enable = useCallback(() => {
31
+ if (isZebraDevice) {
32
+ enableScanner(scanKeySearch);
33
+ }
34
+ else {
35
+ enableCamera(scanKeySearch);
36
+ }
37
+ }, [enableCamera, enableScanner, isZebraDevice, scanKeySearch]);
38
+ return useMemo(() => ({
39
+ enable,
40
+ }), [enable]);
41
+ };
42
+ export const useScannerDeviceActivator = scanKeySearch => {
43
+ const dispatch = useDispatch();
44
+ const enable = useCallback(() => {
45
+ dispatch(enableScan(scanKeySearch));
46
+ }, [dispatch, scanKeySearch]);
47
+ return useMemo(() => ({
48
+ enable,
49
+ }), [enable]);
50
+ };
51
+ export const useCameraScannerActivator = scanKeySearch => {
52
+ const dispatch = useDispatch();
53
+ const enable = useCallback(() => {
54
+ dispatch(enableCameraScanner(scanKeySearch));
55
+ }, [dispatch, scanKeySearch]);
56
+ return useMemo(() => ({
57
+ enable,
58
+ }), [enable]);
59
+ };
60
+ //# sourceMappingURL=use-scan-activator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-scan-activator.js","sourceRoot":"","sources":["../../src/hooks/use-scan-activator.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAChE,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAC,mBAAmB,EAAC,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAC,UAAU,EAAC,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAE3C,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAC,EAAE;IAC9C,MAAM,EAAC,MAAM,EAAE,aAAa,EAAC,GAAG,yBAAyB,CAAC,aAAa,CAAC,CAAC;IACzE,MAAM,EAAC,MAAM,EAAE,YAAY,EAAC,GAAG,yBAAyB,CAAC,aAAa,CAAC,CAAC;IAExE,MAAM,CAAC,aAAa,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEvD,SAAS,CAAC,GAAG,EAAE;QACb,UAAU,CAAC,eAAe,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAC/C,aAAa,CAAC,YAAY,KAAK,oBAAoB,CAAC,CACrD,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,EAAE;QAC9B,IAAI,aAAa,EAAE;YACjB,aAAa,CAAC,aAAa,CAAC,CAAC;SAC9B;aAAM;YACL,YAAY,CAAC,aAAa,CAAC,CAAC;SAC7B;IACH,CAAC,EAAE,CAAC,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,CAAC,CAAC,CAAC;IAEhE,OAAO,OAAO,CACZ,GAAG,EAAE,CAAC,CAAC;QACL,MAAM;KACP,CAAC,EACF,CAAC,MAAM,CAAC,CACT,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG,aAAa,CAAC,EAAE;IACvD,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAE/B,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,EAAE;QAC9B,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC;IACtC,CAAC,EAAE,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC;IAE9B,OAAO,OAAO,CACZ,GAAG,EAAE,CAAC,CAAC;QACL,MAAM;KACP,CAAC,EACF,CAAC,MAAM,CAAC,CACT,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG,aAAa,CAAC,EAAE;IACvD,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAE/B,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,EAAE;QAC9B,QAAQ,CAAC,mBAAmB,CAAC,aAAa,CAAC,CAAC,CAAC;IAC/C,CAAC,EAAE,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC;IAE9B,OAAO,OAAO,CACZ,GAAG,EAAE,CAAC,CAAC;QACL,MAAM;KACP,CAAC,EACF,CAAC,MAAM,CAAC,CACT,CAAC;AACJ,CAAC,CAAC"}
@@ -1,5 +1,7 @@
1
1
  export function getTranslations(language: any): any;
2
- export const selectLanguage: ((state: any) => any) & import("reselect").OutputSelectorFields<(args_0: any) => any> & {
2
+ export const selectLanguage: ((state: any) => any) & import("reselect").OutputSelectorFields<(args_0: any) => any, {
3
+ clearCache: () => void;
4
+ }> & {
3
5
  clearCache: () => void;
4
6
  };
5
7
  export default Translator;
@@ -21,6 +21,7 @@
21
21
  "Base_RealizeContinue": "Realize and continue",
22
22
  "Base_Search": "Search",
23
23
  "Base_Add": "Add",
24
+ "Base_Create": "Create",
24
25
  "Base_Check": "Check",
25
26
  "Base_Start": "Start",
26
27
  "Base_Pause": "Pause",
@@ -32,6 +33,7 @@
32
33
  "Base_Cancel": "Cancel",
33
34
  "Base_Content": "Content",
34
35
  "Base_ViewAll": "View all",
36
+ "Base_ChooseFile": "Choose a file",
35
37
  "Base_NoAppConfigured": "No module configured on your application, please contact an administrator.",
36
38
  "Base_Unknown": "Unknown",
37
39
  "Base_Next": "Next",
@@ -42,6 +44,9 @@
42
44
  "Base_MailMessages": "Mail Messages",
43
45
  "Base_Comment": "Comment",
44
46
  "Base_MailMessages_CommentInput_Placeholder": "Enter a comment",
47
+ "Base_MailMessages_MarkAllAsRead": "Mark all messages as read",
48
+ "Base_MailMessages_Subscribe": "Subscribe",
49
+ "Base_MailMessages_Unsubscribe": "Unsubscribe",
45
50
  "Base_AttachedFiles": "Attached Files",
46
51
  "Base_Question": "Question",
47
52
  "Base_Unfollow_Confirmation": "Are you sure to unfollow this document?",
@@ -57,5 +62,24 @@
57
62
  "Base_Information": "Information",
58
63
  "Base_Refresh": "Refresh application",
59
64
  "Base_Logout": "Log out",
60
- "Base_TimeFormat": "HH:mm"
65
+ "Base_TimeFormat": "HH:mm",
66
+ "Base_ConnectedOn": "Connected on",
67
+ "Base_Error": "Error",
68
+ "Base_Success": "Success",
69
+ "Base_Failed_To": "Failed to",
70
+ "Auth_WrongPasswordOrUserName": "Wrong username or password",
71
+ "Auth_InvalidUrl": "Invalid url",
72
+ "Base_SliceAction_FetchAttachedFiles": "fetch attached files",
73
+ "Base_SliceAction_FetchFilesDetails": "fetch file details",
74
+ "Base_SliceAction_CountAttachedFiles": "count attachment files",
75
+ "Base_SliceAction_FetchMailMessages": "fetch mail messages",
76
+ "Base_SliceAction_PostMailMessageComment": "post mail message comment",
77
+ "Base_SliceAction_FetchModelSubscribers": "fetch model subscribers",
78
+ "Base_SliceAction_SubscribeToModel": "subscribe to model",
79
+ "Base_SliceAction_UnsubscribeFromModel": "unsubscribe from model",
80
+ "Base_SliceAction_CountUnreadMailMessages": "count unread mail messages",
81
+ "Base_SliceAction_MarkMailMessageAsRead": "mark mail message as read",
82
+ "Base_SliceAction_MarkAllMailMessageAsRead": "mark all mail messages as read",
83
+ "Base_SliceAction_FetchMenuConfig": "fetch menu config",
84
+ "Base_SliceAction_FetchMobileConfig": "fetch mobile config"
61
85
  }
@@ -21,6 +21,7 @@
21
21
  "Base_RealizeContinue": "Réaliser et continuer",
22
22
  "Base_Search": "Rechercher",
23
23
  "Base_Add": "Ajouter",
24
+ "Base_Create": "Créer",
24
25
  "Base_Check": "Vérifier",
25
26
  "Base_Start": "Commencer",
26
27
  "Base_Pause": "Mettre en pause",
@@ -32,6 +33,7 @@
32
33
  "Base_Cancel": "Annuler",
33
34
  "Base_Content": "Contenu",
34
35
  "Base_ViewAll": "Tout voir",
36
+ "Base_ChooseFile": "Choisir un fichier",
35
37
  "Base_NoAppConfigured": "Votre application n'est pas configurée, merci de contacter un administrateur.",
36
38
  "Base_Unknown": "Inconnue",
37
39
  "Base_Next": "Suivant",
@@ -42,6 +44,9 @@
42
44
  "Base_MailMessages": "Suivi des notifications",
43
45
  "Base_Comment": "Commentaire",
44
46
  "Base_MailMessages_CommentInput_Placeholder": "Entrez votre commentaire",
47
+ "Base_MailMessages_MarkAllAsRead": "Marquer tous les messages comme lus",
48
+ "Base_MailMessages_Subscribe": "S'abonner",
49
+ "Base_MailMessages_Unsubscribe": "Se désabonner",
45
50
  "Base_AttachedFiles": "Fichiers attachés",
46
51
  "Base_Question": "Question",
47
52
  "Base_Unfollow_Confirmation": "Êtes-vous sûr de vouloir vous désabonner de ce document?",
@@ -57,5 +62,24 @@
57
62
  "Base_Information": "Information",
58
63
  "Base_Refresh": "Actualiser l'application",
59
64
  "Base_Logout": "Déconnexion",
60
- "Base_TimeFormat": "HH:mm"
65
+ "Base_TimeFormat": "HH:mm",
66
+ "Base_ConnectedOn": "Connecté à",
67
+ "Base_Error": "Erreur",
68
+ "Base_Success": "Succès",
69
+ "Base_Failed_To": "N'a pas réussi à effectuer l'action :",
70
+ "Auth_WrongPasswordOrUserName": "Mauvais nom d'utilisateur ou mot de passe",
71
+ "Auth_InvalidUrl": "Url non valide",
72
+ "Base_SliceAction_FetchAttachedFiles": "récupération des fichiers joints",
73
+ "Base_SliceAction_FetchFilesDetails": "récupération des détails du fichier",
74
+ "Base_SliceAction_CountAttachedFiles": "comptage des fichiers joints",
75
+ "Base_SliceAction_FetchMailMessages": "récupération des mail messages",
76
+ "Base_SliceAction_PostMailMessageComment": "ajout d'un mail message",
77
+ "Base_SliceAction_FetchModelSubscribers": "récupération des abonnés du modèle",
78
+ "Base_SliceAction_SubscribeToModel": "abonnement au modèle",
79
+ "Base_SliceAction_UnsubscribeFromModel": "désabonnement au modèle",
80
+ "Base_SliceAction_CountUnreadMailMessages": "comptage des mail messages non lus",
81
+ "Base_SliceAction_MarkMailMessageAsRead": "marquer le message comme lu",
82
+ "Base_SliceAction_MarkAllMailMessageAsRead": "marquer tous les messages comme lus",
83
+ "Base_SliceAction_FetchMenuConfig": "récupération des configs de menus",
84
+ "Base_SliceAction_FetchMobileConfig": "récupération des configs mobile"
61
85
  }
package/lib/index.d.ts CHANGED
@@ -8,6 +8,7 @@ export { login, logout } from './features/authSlice';
8
8
  export * from './apiProviders';
9
9
  export { useScannedValueByKey, useScannerSelector, enableScan, scanValue, disableScan, default as scannerReducer, } from './features/scannerSlice';
10
10
  export { useCameraSelector, useCameraValueByKey, enableCamera, takePhoto, disableCamera, default as cameraReducer, } from './features/cameraSlice';
11
+ export { uploadFile } from './api/metafile-api';
11
12
  export { useDispatch, useSelector } from './redux/hooks';
12
13
  export * from './components';
13
14
  export * from './tools';
@@ -15,3 +16,5 @@ export * from './utils';
15
16
  export * from './types';
16
17
  export * from './auth';
17
18
  export * from './i18n';
19
+ export * from './header';
20
+ export { useNavigation } from './hooks/use-navigation';
package/lib/index.js CHANGED
@@ -25,6 +25,7 @@ export { login, logout } from './features/authSlice';
25
25
  export * from './apiProviders';
26
26
  export { useScannedValueByKey, useScannerSelector, enableScan, scanValue, disableScan, default as scannerReducer, } from './features/scannerSlice';
27
27
  export { useCameraSelector, useCameraValueByKey, enableCamera, takePhoto, disableCamera, default as cameraReducer, } from './features/cameraSlice';
28
+ export { uploadFile } from './api/metafile-api';
28
29
  export { useDispatch, useSelector } from './redux/hooks';
29
30
  export * from './components';
30
31
  export * from './tools';
@@ -32,4 +33,6 @@ export * from './utils';
32
33
  export * from './types';
33
34
  export * from './auth';
34
35
  export * from './i18n';
36
+ export * from './header';
37
+ export { useNavigation } from './hooks/use-navigation';
35
38
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,cAAc,OAAO,CAAC;AACtB,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAChD,OAAO,EAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAC,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAC,iBAAiB,EAAC,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAC,KAAK,EAAE,MAAM,EAAC,MAAM,sBAAsB,CAAC;AACnD,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,UAAU,EACV,SAAS,EACT,WAAW,EACX,OAAO,IAAI,cAAc,GAC1B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,EACZ,SAAS,EACT,aAAa,EACb,OAAO,IAAI,aAAa,GACzB,MAAM,wBAAwB,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,cAAc,UAAU,CAAC;AACzB,OAAO,EAAC,aAAa,EAAC,MAAM,wBAAwB,CAAC"}
@@ -16,7 +16,7 @@
16
16
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
17
  */
18
18
  import React, { createContext, useCallback, useEffect, useMemo, useState, } from 'react';
19
- import { Dimensions, StyleSheet } from 'react-native';
19
+ import { Dimensions } from 'react-native';
20
20
  import { createDrawerNavigator } from '@react-navigation/drawer';
21
21
  import { createStackNavigator } from '@react-navigation/stack';
22
22
  import { useThemeColor } from '@axelor/aos-mobile-ui';
@@ -24,13 +24,12 @@ import DrawerContent from './drawer/DrawerContent';
24
24
  import { filterAuthorizedModules, getDefaultModule, manageOverridingMenus, moduleHasMenus, updateAccessibleMenus, } from './module.helper';
25
25
  import { getMenuTitle } from './menu.helper';
26
26
  import useTranslator from '../i18n/hooks/use-translator';
27
- import DrawerToggleButton from './drawer/DrawerToggleButton';
28
- import BackIcon from './drawer/BackIcon';
29
27
  import { useDispatch, useSelector } from 'react-redux';
30
28
  import { fetchMenuConfig } from '../features/menuConfigSlice';
31
29
  import { fetchMobileConfig } from '../features/mobileConfigSlice';
32
30
  import AttachedFilesScreen from '../screens/AttachedFilesScreen';
33
31
  import MailMessageScreen from '../screens/MailMessageScreen';
32
+ import Header from './drawer/Header';
34
33
  const Drawer = createDrawerNavigator();
35
34
  const Stack = createStackNavigator();
36
35
  export const ModuleNavigatorContext = createContext({
@@ -51,7 +50,6 @@ const Navigator = ({ modules, mainMenu, showModulesSubtitle = false, onRefresh,
51
50
  dispatch(fetchMobileConfig());
52
51
  dispatch(fetchMenuConfig());
53
52
  }, [dispatch]);
54
- const styles = useMemo(() => getHeaderStyles(Colors), [Colors]);
55
53
  const changeActiveModule = useCallback(moduleName => {
56
54
  setActiveModule(enabledModule.find(_module => _module.name === moduleName));
57
55
  }, [enabledModule]);
@@ -72,30 +70,23 @@ const Navigator = ({ modules, mainMenu, showModulesSubtitle = false, onRefresh,
72
70
  MailMessageScreen: {
73
71
  title: 'Base_MailMessages',
74
72
  component: MailMessageScreen,
73
+ actionID: 'core_mailMessage_details',
75
74
  options: {
76
75
  shadedHeader: false,
77
76
  },
78
77
  },
79
78
  }), [modules]);
80
79
  const ModulesScreensStackNavigator = useCallback(({ initialRouteName, ...rest }) => (<Stack.Navigator {...rest} initialRouteName={initialRouteName}>
81
- {Object.entries(modulesScreens).map(([key, { component, title, options = { shadedHeader: true } }]) => {
82
- const screenOptions = {
83
- headerTintColor: Colors.primaryColor.background,
84
- headerStyle: options?.shadedHeader
85
- ? styles.headerColor
86
- : styles.listScreenHeaderStyle,
87
- headerTitle: I18n.t(title),
88
- headerTitleStyle: styles.headerTitle,
89
- };
90
- if (initialRouteName === key) {
91
- screenOptions.headerLeft = () => (<DrawerToggleButton tintColor={Colors.primaryColor.background}/>);
92
- }
93
- else {
94
- screenOptions.headerLeft = () => (<BackIcon tintColor={Colors.primaryColor.background}/>);
95
- }
96
- return (<Stack.Screen key={key} name={key} component={component} options={screenOptions}/>);
80
+ {Object.entries(modulesScreens).map(([key, { component, title, actionID, options = { shadedHeader: true } },]) => {
81
+ return (<Stack.Screen key={key} name={key} component={component} options={{
82
+ headerStyle: { elevation: 0 },
83
+ headerLeft: () => null,
84
+ headerRight: () => null,
85
+ headerTitleStyle: { width: '100%' },
86
+ headerTitle: () => (<Header mainScreen={initialRouteName === key} title={title} actionID={actionID} shadedHeader={options?.shadedHeader}/>),
87
+ }}/>);
97
88
  })}
98
- </Stack.Navigator>), [Colors, I18n, modulesScreens, styles]);
89
+ </Stack.Navigator>), [modulesScreens]);
99
90
  const windowWidth = Dimensions.get('window').width;
100
91
  const isLargeScreen = windowWidth >= 768;
101
92
  return (<ModuleNavigatorContext.Provider value={{ activeModule, modulesMenus, modulesScreens }}>
@@ -114,19 +105,5 @@ const Navigator = ({ modules, mainMenu, showModulesSubtitle = false, onRefresh,
114
105
  </Drawer.Navigator>
115
106
  </ModuleNavigatorContext.Provider>);
116
107
  };
117
- const getHeaderStyles = Colors => StyleSheet.create({
118
- headerTitle: {
119
- color: Colors.text,
120
- marginLeft: -14,
121
- },
122
- headerColor: {
123
- backgroundColor: Colors.backgroundColor,
124
- elevation: 3,
125
- },
126
- listScreenHeaderStyle: {
127
- backgroundColor: Colors.backgroundColor,
128
- elevation: 0,
129
- },
130
- });
131
108
  export default Navigator;
132
109
  //# sourceMappingURL=Navigator.js.map