@axelor/aos-mobile-core 7.0.3 → 7.0.5
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.
- package/lib/api/metafile-api.d.ts +13 -1
- package/lib/api/metafile-api.js +19 -5
- package/lib/api/metafile-api.js.map +1 -1
- package/lib/api/mobile-config-api.js +9 -15
- package/lib/api/mobile-config-api.js.map +1 -1
- package/lib/api/model-api.d.ts +4 -0
- package/lib/api/model-api.js +28 -0
- package/lib/api/model-api.js.map +1 -0
- package/lib/apiProviders/utils.d.ts +7 -7
- package/lib/apiProviders/utils.js +31 -23
- package/lib/apiProviders/utils.js.map +1 -1
- package/lib/app/Module.d.ts +15 -2
- package/lib/auth/api/user-api.js +5 -3
- package/lib/auth/api/user-api.js.map +1 -1
- package/lib/auth/features/companySlice.d.ts +1 -1
- package/lib/auth/features/configSlice.d.ts +1 -1
- package/lib/auth/features/languageSlice.d.ts +1 -1
- package/lib/auth/features/userSlice.d.ts +1 -1
- package/lib/auth/features/userSlice.js +7 -5
- package/lib/auth/features/userSlice.js.map +1 -1
- package/lib/auth/i18n/en.json +0 -16
- package/lib/auth/i18n/fr.json +0 -16
- package/lib/auth/index.js +1 -0
- package/lib/auth/index.js.map +1 -1
- package/lib/auth/models/objectFields.js +14 -0
- package/lib/auth/models/objectFields.js.map +1 -1
- package/lib/components/external/Camera/Camera.js +15 -5
- package/lib/components/external/Camera/Camera.js.map +1 -1
- package/lib/components/external/Camera/CaptureButton.d.ts +2 -1
- package/lib/components/external/Camera/CaptureButton.js +3 -3
- package/lib/components/external/Camera/CaptureButton.js.map +1 -1
- package/lib/components/external/Stopwatch/Stopwatch.d.ts +5 -1
- package/lib/components/external/Stopwatch/Stopwatch.js +41 -11
- package/lib/components/external/Stopwatch/Stopwatch.js.map +1 -1
- package/lib/components/external/Timer/Timer.d.ts +3 -2
- package/lib/components/external/Timer/Timer.js +5 -4
- package/lib/components/external/Timer/Timer.js.map +1 -1
- package/lib/components/molecules/CameraButton/CameraButton.d.ts +12 -0
- package/lib/components/molecules/CameraButton/CameraButton.js +87 -0
- package/lib/components/molecules/CameraButton/CameraButton.js.map +1 -0
- package/lib/components/molecules/UploadFileInput/UploadFileInput.d.ts +13 -2
- package/lib/components/molecules/UploadFileInput/UploadFileInput.js +183 -20
- package/lib/components/molecules/UploadFileInput/UploadFileInput.js.map +1 -1
- package/lib/components/molecules/index.d.ts +1 -3
- package/lib/components/molecules/index.js +1 -3
- package/lib/components/molecules/index.js.map +1 -1
- package/lib/components/organisms/DateInput/DateInput.d.ts +2 -1
- package/lib/components/organisms/DateInput/DateInput.js +8 -5
- package/lib/components/organisms/DateInput/DateInput.js.map +1 -1
- package/lib/components/organisms/HeaderOptionsMenu/HeaderOptionsMenu.d.ts +2 -1
- package/lib/components/organisms/HeaderOptionsMenu/HeaderOptionsMenu.js +5 -4
- package/lib/components/organisms/HeaderOptionsMenu/HeaderOptionsMenu.js.map +1 -1
- package/lib/components/organisms/index.d.ts +1 -6
- package/lib/components/organisms/index.js +1 -6
- package/lib/components/organisms/index.js.map +1 -1
- package/lib/components/templates/AttachedFilesView/AttachedFilesView.js +1 -1
- package/lib/components/templates/AttachedFilesView/AttachedFilesView.js.map +1 -1
- package/lib/components/templates/index.d.ts +0 -3
- package/lib/components/templates/index.js +0 -3
- package/lib/components/templates/index.js.map +1 -1
- package/lib/config/routes.d.ts +16 -16
- package/lib/features/attachedFilesSlice.d.ts +1 -1
- package/lib/features/authSlice.d.ts +1 -1
- package/lib/features/cameraScannerSlice.d.ts +2 -2
- package/lib/features/cameraScannerSlice.js +4 -1
- package/lib/features/cameraScannerSlice.js.map +1 -1
- package/lib/features/cameraSlice.d.ts +13 -4
- package/lib/features/cameraSlice.js +4 -1
- package/lib/features/cameraSlice.js.map +1 -1
- package/lib/features/mailMessageSlice.d.ts +1 -1
- package/lib/features/menuConfigSlice.d.ts +1 -1
- package/lib/features/metaModuleSlice.d.ts +1 -1
- package/lib/features/metafileSlice.d.ts +1 -1
- package/lib/features/mobileConfigSlice.d.ts +1 -1
- package/lib/features/onlineSlice.d.ts +1 -1
- package/lib/features/scannerSlice.d.ts +2 -2
- package/lib/features/scannerSlice.js +4 -1
- package/lib/features/scannerSlice.js.map +1 -1
- package/lib/header/HeaderActionsProvider.d.ts +3 -4
- package/lib/header/HeaderActionsProvider.js +16 -10
- package/lib/header/HeaderActionsProvider.js.map +1 -1
- package/lib/header/hooks.d.ts +15 -1
- package/lib/header/hooks.js +28 -2
- package/lib/header/hooks.js.map +1 -1
- package/lib/header/index.d.ts +2 -1
- package/lib/header/index.js +2 -1
- package/lib/header/index.js.map +1 -1
- package/lib/header/types.d.ts +1 -0
- package/lib/i18n/component/Translator.d.ts +1 -1
- package/lib/i18n/hooks/use-translator.d.ts +1 -1
- package/lib/i18n/hooks/use-translator.js +3 -1
- package/lib/i18n/hooks/use-translator.js.map +1 -1
- package/lib/i18n/translations/en.json +35 -4
- package/lib/i18n/translations/fr.json +35 -4
- package/lib/index.d.ts +2 -2
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/navigator/Navigator.d.ts +1 -1
- package/lib/navigator/Navigator.js +21 -25
- package/lib/navigator/Navigator.js.map +1 -1
- package/lib/navigator/drawer/DrawerContent.js +39 -21
- package/lib/navigator/drawer/DrawerContent.js.map +1 -1
- package/lib/navigator/drawer/Header.js +26 -6
- package/lib/navigator/drawer/Header.js.map +1 -1
- package/lib/navigator/drawer/Menu.d.ts +2 -1
- package/lib/navigator/drawer/Menu.js +42 -17
- package/lib/navigator/drawer/Menu.js.map +1 -1
- package/lib/navigator/drawer/MenuItem.d.ts +8 -5
- package/lib/navigator/drawer/MenuItem.js +11 -51
- package/lib/navigator/drawer/MenuItem.js.map +1 -1
- package/lib/navigator/drawer/MenuItemEntry.d.ts +12 -0
- package/lib/navigator/drawer/MenuItemEntry.js +89 -0
- package/lib/navigator/drawer/MenuItemEntry.js.map +1 -0
- package/lib/navigator/drawer/SubMenuItem.d.ts +7 -0
- package/lib/navigator/drawer/SubMenuItem.js +34 -0
- package/lib/navigator/drawer/SubMenuItem.js.map +1 -0
- package/lib/navigator/drawer/SubMenuItemList.d.ts +10 -0
- package/lib/navigator/drawer/SubMenuItemList.js +46 -0
- package/lib/navigator/drawer/SubMenuItemList.js.map +1 -0
- package/lib/navigator/menu.helper.d.ts +9 -0
- package/lib/navigator/menu.helper.js +92 -0
- package/lib/navigator/menu.helper.js.map +1 -1
- package/lib/navigator/module.helper.d.ts +5 -0
- package/lib/navigator/module.helper.js +37 -1
- package/lib/navigator/module.helper.js.map +1 -1
- package/lib/redux/store.d.ts +1 -1
- package/lib/screens/BarcodeDisplayScreen.d.ts +4 -0
- package/lib/screens/BarcodeDisplayScreen.js +54 -0
- package/lib/screens/BarcodeDisplayScreen.js.map +1 -0
- package/lib/screens/LoginScreen.js +47 -73
- package/lib/screens/LoginScreen.js.map +1 -1
- package/lib/screens/SessionManagementScreen.js +41 -21
- package/lib/screens/SessionManagementScreen.js.map +1 -1
- package/lib/screens/index.d.ts +38 -0
- package/lib/screens/index.js +47 -0
- package/lib/screens/index.js.map +1 -0
- package/lib/sessions/SessionStorage.d.ts +4 -5
- package/lib/sessions/SessionStorage.js +30 -22
- package/lib/sessions/SessionStorage.js.map +1 -1
- package/lib/sessions/components/alerts/PopupCreateSession.d.ts +10 -0
- package/lib/sessions/components/alerts/PopupCreateSession.js +137 -0
- package/lib/sessions/components/alerts/PopupCreateSession.js.map +1 -0
- package/lib/sessions/components/alerts/PopupEditSession.d.ts +8 -0
- package/lib/sessions/components/alerts/PopupEditSession.js +84 -0
- package/lib/sessions/components/alerts/PopupEditSession.js.map +1 -0
- package/lib/sessions/components/alerts/PopupSession.d.ts +9 -0
- package/lib/sessions/components/alerts/PopupSession.js +84 -0
- package/lib/sessions/components/alerts/PopupSession.js.map +1 -0
- package/lib/sessions/components/alerts/index.d.ts +3 -0
- package/lib/sessions/components/alerts/index.js +21 -0
- package/lib/sessions/components/alerts/index.js.map +1 -0
- package/lib/sessions/components/buttons/DisabledButton.d.ts +7 -0
- package/lib/{components/molecules/LoginButton/LoginButton.js → sessions/components/buttons/DisabledButton.js} +5 -5
- package/lib/sessions/components/buttons/DisabledButton.js.map +1 -0
- package/lib/sessions/components/buttons/LoginButton.js +24 -0
- package/lib/sessions/components/buttons/LoginButton.js.map +1 -0
- package/lib/sessions/components/buttons/UpdateButton.d.ts +6 -0
- package/lib/sessions/components/buttons/UpdateButton.js +24 -0
- package/lib/sessions/components/buttons/UpdateButton.js.map +1 -0
- package/lib/sessions/components/buttons/index.d.ts +3 -0
- package/lib/sessions/components/buttons/index.js +21 -0
- package/lib/sessions/components/buttons/index.js.map +1 -0
- package/lib/sessions/components/display/LogoImage.js.map +1 -0
- package/lib/sessions/components/display/SessionCard.d.ts +9 -0
- package/lib/sessions/components/display/SessionCard.js +185 -0
- package/lib/sessions/components/display/SessionCard.js.map +1 -0
- package/lib/sessions/components/display/SessionListCard.d.ts +10 -0
- package/lib/sessions/components/display/SessionListCard.js +75 -0
- package/lib/sessions/components/display/SessionListCard.js.map +1 -0
- package/lib/sessions/components/display/index.d.ts +3 -0
- package/lib/sessions/components/display/index.js +21 -0
- package/lib/sessions/components/display/index.js.map +1 -0
- package/lib/{components/molecules/ErrorText → sessions/components/error}/ErrorText.js +2 -2
- package/lib/sessions/components/error/ErrorText.js.map +1 -0
- package/lib/sessions/components/error/index.d.ts +1 -0
- package/lib/sessions/components/error/index.js +19 -0
- package/lib/sessions/components/error/index.js.map +1 -0
- package/lib/sessions/components/index.d.ts +5 -0
- package/lib/sessions/components/index.js +23 -0
- package/lib/sessions/components/index.js.map +1 -0
- package/lib/sessions/components/inputs/DefaultCheckbox.d.ts +8 -0
- package/lib/sessions/components/inputs/DefaultCheckbox.js +36 -0
- package/lib/sessions/components/inputs/DefaultCheckbox.js.map +1 -0
- package/lib/{components/organisms/PasswordInput → sessions/components/inputs}/PasswordInput.d.ts +2 -1
- package/lib/{components/organisms/PasswordInput → sessions/components/inputs}/PasswordInput.js +5 -2
- package/lib/sessions/components/inputs/PasswordInput.js.map +1 -0
- package/lib/sessions/components/inputs/SessionInputs.d.ts +13 -0
- package/lib/sessions/components/inputs/SessionInputs.js +180 -0
- package/lib/sessions/components/inputs/SessionInputs.js.map +1 -0
- package/lib/{components/organisms/SessionNameInput → sessions/components/inputs}/SessionNameInput.d.ts +2 -1
- package/lib/{components/organisms/SessionNameInput → sessions/components/inputs}/SessionNameInput.js +5 -2
- package/lib/sessions/components/inputs/SessionNameInput.js.map +1 -0
- package/lib/{components/organisms/UrlInput → sessions/components/inputs}/UrlInput.d.ts +2 -1
- package/lib/{components/organisms/UrlInput → sessions/components/inputs}/UrlInput.js +14 -3
- package/lib/sessions/components/inputs/UrlInput.js.map +1 -0
- package/lib/{components/organisms/UsernameInput → sessions/components/inputs}/UsernameInput.js +10 -2
- package/lib/sessions/components/inputs/UsernameInput.js.map +1 -0
- package/lib/sessions/components/inputs/index.d.ts +6 -0
- package/lib/sessions/components/inputs/index.js +24 -0
- package/lib/sessions/components/inputs/index.js.map +1 -0
- package/lib/sessions/hook.d.ts +1 -1
- package/lib/sessions/hook.js +5 -5
- package/lib/sessions/hook.js.map +1 -1
- package/lib/sessions/index.d.ts +2 -1
- package/lib/sessions/index.js +2 -1
- package/lib/sessions/index.js.map +1 -1
- package/lib/sessions/type.d.ts +2 -1
- package/lib/sessions/type.js.map +1 -1
- package/lib/sessions/utils.d.ts +2 -1
- package/lib/sessions/utils.js +26 -7
- package/lib/sessions/utils.js.map +1 -1
- package/lib/tools/ContactProvider.d.ts +9 -0
- package/lib/tools/ContactProvider.js +98 -0
- package/lib/tools/ContactProvider.js.map +1 -0
- package/lib/tools/contact.helper.d.ts +21 -0
- package/lib/tools/contact.helper.js +136 -0
- package/lib/tools/contact.helper.js.map +1 -0
- package/lib/tools/index.d.ts +1 -0
- package/lib/tools/index.js +1 -0
- package/lib/tools/index.js.map +1 -1
- package/lib/utils/date.d.ts +16 -0
- package/lib/utils/date.js +41 -0
- package/lib/utils/date.js.map +1 -1
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/index.js +1 -1
- package/lib/utils/index.js.map +1 -1
- package/package.json +12 -10
- package/lib/components/molecules/ErrorText/ErrorText.js.map +0 -1
- package/lib/components/molecules/LoginButton/LoginButton.js.map +0 -1
- package/lib/components/molecules/SessionNumberIndicator/SessionNumberIndicator.d.ts +0 -4
- package/lib/components/molecules/SessionNumberIndicator/SessionNumberIndicator.js +0 -44
- package/lib/components/molecules/SessionNumberIndicator/SessionNumberIndicator.js.map +0 -1
- package/lib/components/organisms/LogoImage/LogoImage.js.map +0 -1
- package/lib/components/organisms/PasswordInput/PasswordInput.js.map +0 -1
- package/lib/components/organisms/SessionButtons/SessionButtons.d.ts +0 -17
- package/lib/components/organisms/SessionButtons/SessionButtons.js +0 -93
- package/lib/components/organisms/SessionButtons/SessionButtons.js.map +0 -1
- package/lib/components/organisms/SessionNameInput/SessionNameInput.js.map +0 -1
- package/lib/components/organisms/UrlInput/UrlInput.js.map +0 -1
- package/lib/components/organisms/UsernameInput/UsernameInput.js.map +0 -1
- package/lib/components/templates/PopupCreateSession/PopupCreateSession.d.ts +0 -10
- package/lib/components/templates/PopupCreateSession/PopupCreateSession.js +0 -171
- package/lib/components/templates/PopupCreateSession/PopupCreateSession.js.map +0 -1
- package/lib/components/templates/PopupSession/PopupSession.d.ts +0 -8
- package/lib/components/templates/PopupSession/PopupSession.js +0 -135
- package/lib/components/templates/PopupSession/PopupSession.js.map +0 -1
- package/lib/components/templates/PopupSessionList/PopupSessionList.d.ts +0 -7
- package/lib/components/templates/PopupSessionList/PopupSessionList.js +0 -107
- package/lib/components/templates/PopupSessionList/PopupSessionList.js.map +0 -1
- /package/lib/{components/molecules/LoginButton → sessions/components/buttons}/LoginButton.d.ts +0 -0
- /package/lib/{components/organisms/LogoImage → sessions/components/display}/LogoImage.d.ts +0 -0
- /package/lib/{components/organisms/LogoImage → sessions/components/display}/LogoImage.js +0 -0
- /package/lib/{components/molecules/ErrorText → sessions/components/error}/ErrorText.d.ts +0 -0
- /package/lib/{components/organisms/UsernameInput → sessions/components/inputs}/UsernameInput.d.ts +0 -0
package/lib/sessions/utils.js
CHANGED
|
@@ -17,13 +17,16 @@
|
|
|
17
17
|
*/
|
|
18
18
|
import { storage } from '../storage/Storage';
|
|
19
19
|
import { URL_STORAGE_KEY } from './type';
|
|
20
|
-
export const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
export const manageDefaultSession = (sessionList, session) => {
|
|
21
|
+
if (session.isDefault) {
|
|
22
|
+
return sessionList.map(_session => {
|
|
23
|
+
if (_session.id === session.id) {
|
|
24
|
+
return { ..._session, isDefault: true };
|
|
25
|
+
}
|
|
26
|
+
return { ..._session, isDefault: false };
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
return sessionList;
|
|
27
30
|
};
|
|
28
31
|
export const getStorageUrl = () => {
|
|
29
32
|
return storage.getItem(URL_STORAGE_KEY);
|
|
@@ -31,4 +34,20 @@ export const getStorageUrl = () => {
|
|
|
31
34
|
export const saveUrlInStorage = (url) => {
|
|
32
35
|
storage.setItem(URL_STORAGE_KEY, url);
|
|
33
36
|
};
|
|
37
|
+
export const migrateOldSessionToNewSystem = (data) => {
|
|
38
|
+
return data.map((_item, index) => {
|
|
39
|
+
if (_item?.name == null) {
|
|
40
|
+
return {
|
|
41
|
+
id: `session-${Date.now()}-${index}`,
|
|
42
|
+
name: _item.id,
|
|
43
|
+
url: _item.url,
|
|
44
|
+
username: _item.username,
|
|
45
|
+
isDefault: _item.isActive,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
return _item;
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
};
|
|
34
53
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/sessions/ut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/B,IAAI,KAAK,EAAE,IAAI,IAAI,IAAI,EAAE;YACvB,OAAO;gBACL,EAAE,EAAE,WAAW,IAAI,CAAC,GAAG,EAAE,IAAI,KAAK,EAAE;gBACpC,IAAI,EAAE,KAAK,CAAC,EAAE;gBACd,GAAG,EAAE,KAAK,CAAC,GAAG;gBACd,QAAQ,EAAE,KAAK,CAAC,QAAQ;gBACxB,SAAS,EAAE,KAAK,CAAC,QAAQ;aAC1B,CAAC;SACH;aAAM;YACL,OAAO,KAAgB,CAAC;SACzB;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ContactData } from './contact.helper';
|
|
2
|
+
declare class ContactProvider {
|
|
3
|
+
constructor();
|
|
4
|
+
private _getContactsPermission;
|
|
5
|
+
private _showToast;
|
|
6
|
+
saveContact: (contactData: ContactData) => Promise<boolean>;
|
|
7
|
+
}
|
|
8
|
+
export declare const contactProvider: ContactProvider;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,98 @@
|
|
|
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 { PermissionsAndroid, Platform } from 'react-native';
|
|
19
|
+
import Toast from 'react-native-toast-message';
|
|
20
|
+
import * as Contacts from 'react-native-contacts';
|
|
21
|
+
import { PermissionResult, parseContactData, } from './contact.helper';
|
|
22
|
+
class ContactProvider {
|
|
23
|
+
constructor() { }
|
|
24
|
+
_getContactsPermission = async () => {
|
|
25
|
+
try {
|
|
26
|
+
switch (Platform.OS) {
|
|
27
|
+
case 'ios':
|
|
28
|
+
const _permIOS = await Contacts.requestPermission();
|
|
29
|
+
switch (_permIOS) {
|
|
30
|
+
case 'authorized':
|
|
31
|
+
return PermissionResult.GRANTED;
|
|
32
|
+
default:
|
|
33
|
+
return PermissionResult.DENIED;
|
|
34
|
+
}
|
|
35
|
+
case 'android':
|
|
36
|
+
const _permAndroid = await PermissionsAndroid.requestMultiple([
|
|
37
|
+
PermissionsAndroid.PERMISSIONS.READ_CONTACTS,
|
|
38
|
+
PermissionsAndroid.PERMISSIONS.WRITE_CONTACTS,
|
|
39
|
+
]);
|
|
40
|
+
if (Object.values(_permAndroid).every(_perm => _perm === PermissionsAndroid.RESULTS.GRANTED)) {
|
|
41
|
+
return PermissionResult.GRANTED;
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
return PermissionResult.DENIED;
|
|
45
|
+
}
|
|
46
|
+
default:
|
|
47
|
+
throw new Error('Unsupported device.');
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
console.error('Error requesting contacts permission:', error);
|
|
52
|
+
return PermissionResult.DENIED;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
_showToast = (type, message) => {
|
|
56
|
+
Toast.show({
|
|
57
|
+
type,
|
|
58
|
+
position: 'bottom',
|
|
59
|
+
bottomOffset: 20,
|
|
60
|
+
text1: type === 'success' ? 'Success' : 'Error',
|
|
61
|
+
text2: message,
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
saveContact = async (contactData) => {
|
|
65
|
+
try {
|
|
66
|
+
if (!contactData.firstName) {
|
|
67
|
+
throw new Error('Required contact data is missing.');
|
|
68
|
+
}
|
|
69
|
+
const permissionResult = await this._getContactsPermission();
|
|
70
|
+
switch (permissionResult) {
|
|
71
|
+
case PermissionResult.GRANTED:
|
|
72
|
+
const contactAdded = await Contacts.openContactForm(parseContactData(contactData)).then(_contact => {
|
|
73
|
+
if (_contact != null) {
|
|
74
|
+
this._showToast('success', `Contact ${_contact.givenName} added successfully.`);
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
this._showToast('error', 'Contact addition was canceled.');
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
return contactAdded;
|
|
83
|
+
case PermissionResult.DENIED:
|
|
84
|
+
this._showToast('error', 'Contacts permission denied.');
|
|
85
|
+
return false;
|
|
86
|
+
default:
|
|
87
|
+
this._showToast('error', 'Unknown permission result.');
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
this._showToast('error', `Error adding contact: ${error}`);
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
export const contactProvider = new ContactProvider();
|
|
98
|
+
//# sourceMappingURL=ContactProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContactProvider.js","sourceRoot":"","sources":["../../src/tools/ContactProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,kBAAkB,EAAE,QAAQ,EAAC,MAAM,cAAc,CAAC;AAC1D,OAAO,KAAK,MAAM,4BAA4B,CAAC;AAC/C,OAAO,KAAK,QAAQ,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAEL,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,eAAe;IACnB,gBAAe,CAAC;IAER,sBAAsB,GAAG,KAAK,IAAI,EAAE;QAC1C,IAAI;YACF,QAAQ,QA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: string;
|
|
5
|
+
company?: string;
|
|
6
|
+
mobilePhone?: string;
|
|
7
|
+
fixedPhone?: string;
|
|
8
|
+
email?: string;
|
|
9
|
+
address?: {
|
|
10
|
+
street?: string;
|
|
11
|
+
postCode?: string;
|
|
12
|
+
city?: string;
|
|
13
|
+
country?: string;
|
|
14
|
+
};
|
|
15
|
+
notes?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare enum PermissionResult {
|
|
18
|
+
DENIED = "denied",
|
|
19
|
+
GRANTED = "granted"
|
|
20
|
+
}
|
|
21
|
+
export declare const parseContactData: (contact: ContactData) => Partial<Contacts.Contact>;
|
|
@@ -0,0 +1,136 @@
|
|
|
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 { isEmpty } from '../utils';
|
|
19
|
+
import { Platform } from 'react-native';
|
|
20
|
+
export var PermissionResult;
|
|
21
|
+
(function (PermissionResult) {
|
|
22
|
+
PermissionResult["DENIED"] = "denied";
|
|
23
|
+
PermissionResult["GRANTED"] = "granted";
|
|
24
|
+
})(PermissionResult || (PermissionResult = {}));
|
|
25
|
+
const CONTACT_MAPPER = {
|
|
26
|
+
firstName: {
|
|
27
|
+
key: 'givenName',
|
|
28
|
+
type: 'info',
|
|
29
|
+
},
|
|
30
|
+
lastName: {
|
|
31
|
+
key: 'familyName',
|
|
32
|
+
type: 'info',
|
|
33
|
+
},
|
|
34
|
+
company: {
|
|
35
|
+
key: 'company',
|
|
36
|
+
type: 'info',
|
|
37
|
+
},
|
|
38
|
+
notes: {
|
|
39
|
+
key: 'note',
|
|
40
|
+
type: 'info',
|
|
41
|
+
},
|
|
42
|
+
mobilePhone: {
|
|
43
|
+
key: 'phoneNumbers',
|
|
44
|
+
type: 'phone',
|
|
45
|
+
label: 'mobile',
|
|
46
|
+
},
|
|
47
|
+
fixedPhone: {
|
|
48
|
+
key: 'phoneNumbers',
|
|
49
|
+
type: 'phone',
|
|
50
|
+
label: 'fixed',
|
|
51
|
+
},
|
|
52
|
+
email: {
|
|
53
|
+
key: 'emailAddresses',
|
|
54
|
+
type: 'email',
|
|
55
|
+
label: 'work',
|
|
56
|
+
},
|
|
57
|
+
address: {
|
|
58
|
+
key: 'postalAddresses',
|
|
59
|
+
type: 'address',
|
|
60
|
+
label: 'main address',
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
const manageAndroidName = (data) => {
|
|
64
|
+
let result = '';
|
|
65
|
+
if (data.firstName != null) {
|
|
66
|
+
result = result.concat(data.firstName);
|
|
67
|
+
}
|
|
68
|
+
if (data.lastName != null) {
|
|
69
|
+
result = result.concat(' ').concat(data.lastName);
|
|
70
|
+
}
|
|
71
|
+
return result;
|
|
72
|
+
};
|
|
73
|
+
const manageArrayField = (array, value) => {
|
|
74
|
+
const _array = Array.isArray(array) ? [...array] : [];
|
|
75
|
+
_array.push(value);
|
|
76
|
+
return _array;
|
|
77
|
+
};
|
|
78
|
+
const managePhoneField = (value, label) => ({
|
|
79
|
+
label: label,
|
|
80
|
+
number: value,
|
|
81
|
+
});
|
|
82
|
+
const manageEmailField = (value, label) => ({
|
|
83
|
+
label: label,
|
|
84
|
+
email: value,
|
|
85
|
+
});
|
|
86
|
+
const manageAddressField = (value, label) => {
|
|
87
|
+
const DEFAULT = '';
|
|
88
|
+
const street = value?.street || DEFAULT;
|
|
89
|
+
const postCode = value?.postCode || DEFAULT;
|
|
90
|
+
const city = value?.city || DEFAULT;
|
|
91
|
+
const country = value?.country || DEFAULT;
|
|
92
|
+
return {
|
|
93
|
+
label: label,
|
|
94
|
+
formattedAddress: `${street} ${postCode} ${city} ${country}`,
|
|
95
|
+
street,
|
|
96
|
+
pobox: DEFAULT,
|
|
97
|
+
neighborhood: DEFAULT,
|
|
98
|
+
city,
|
|
99
|
+
region: DEFAULT,
|
|
100
|
+
state: DEFAULT,
|
|
101
|
+
postCode,
|
|
102
|
+
country,
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
export const parseContactData = (contact) => {
|
|
106
|
+
if (isEmpty(contact)) {
|
|
107
|
+
return {};
|
|
108
|
+
}
|
|
109
|
+
const result = {};
|
|
110
|
+
Object.entries(CONTACT_MAPPER).forEach(([key, config]) => {
|
|
111
|
+
const value = contact[key];
|
|
112
|
+
if (value != null) {
|
|
113
|
+
switch (config.type) {
|
|
114
|
+
case 'info':
|
|
115
|
+
result[config.key] = value;
|
|
116
|
+
break;
|
|
117
|
+
case 'phone':
|
|
118
|
+
result[config.key] = manageArrayField(result[config.key], managePhoneField(value, config.label));
|
|
119
|
+
break;
|
|
120
|
+
case 'email':
|
|
121
|
+
result[config.key] = manageArrayField(result[config.key], manageEmailField(value, config.label));
|
|
122
|
+
break;
|
|
123
|
+
case 'address':
|
|
124
|
+
result[config.key] = manageArrayField(result[config.key], manageAddressField(value, config.label));
|
|
125
|
+
break;
|
|
126
|
+
default:
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
if (Platform.OS === 'android') {
|
|
132
|
+
result.displayName = manageAndroidName(contact);
|
|
133
|
+
}
|
|
134
|
+
return result;
|
|
135
|
+
};
|
|
136
|
+
//# sourceMappingURL=contact.helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contact.helper.js","sourceRoot":"","sources":["../../src/tools/contact.helper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAC,OAAO,EAAC,MAAM,UAAU,CAAC;AACjC,OAAO,EAAC,QAAQ,EAAC,MAAM,cAAc,CAAC;AAkBtC,MAAM,CAAN,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,qCAAiB,CAAA;IACjB,uCAAmB,CAAA;AACrB,CAAC,EAHW,gBAAgB,KAAhB,gBAAgB,QAG3B;AAED,MAAM,cAAc,GAMhB;IACF,SAAS,EAAE;QACT,GAAG,EAAE,WAAW;QAChB,IAAI,EAAE,MAAM;KACb;IACD,QAAQ,EAAE;QACR,GAAG,EAAE,YAAY;QACjB,IAAI,EAAE,MAAM;KACb;IACD,OAAO,EAAE;QACP,GAAG,EAAE,SAAS;QACd,IAAI,EAAE,MAAM;KACb;IACD,KAAK,EAAE;QACL,GAAG,EAAE,MAAM;QACX,IAAI,EAAE,MAAM;KACb;IACD,WAAW,EAAE;QACX,GAAG,EAAE,cAAc;QACnB,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,QAAQ;KAChB;IACD,UAAU,EAAE;QACV,GAAG,EAAE,cAAc;QACnB,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,OAAO;KACf;IACD,KAAK,EAAE;QACL,GAAG,EAAE,gBAAgB;QACrB,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,MAAM;KACd;IACD,OAAO,EAAE;QACP,GAAG,EAAE,iBAAiB;QACtB,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,cAAc;KACtB;CACF,CAAC;AAEF,MAAM,iBAAiB,GAAG,CAAC,IAAiB,EAAE,EAAE;IAC9C,IAAI,MAAM,GAAG,EAAE,CAAC;IAEhB,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,EAAE;QAC1B,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS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AM,CAAC,KAAK,CAAC,CACxC,CAAC;oBACF,MAAM;gBACR;oBACE,MAAM;aACT;SACF;IACH,CAAC,CAAC,CAAC;IAEH,IAAI,QAAQ,CAAC,EAAE,KAAK,SAAS,EAAE;QAC7B,MAAM,CAAC,WAAW,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;KACjD;IAED,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
|
package/lib/tools/index.d.ts
CHANGED
package/lib/tools/index.js
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
18
|
export { clipboardProvider } from './ClipboardProvider';
|
|
19
|
+
export { contactProvider } from './ContactProvider';
|
|
19
20
|
export { openFileInExternalApp } from './FileViewer';
|
|
20
21
|
export { linkingProvider } from './LinkingProvider';
|
|
21
22
|
//# sourceMappingURL=index.js.map
|
package/lib/tools/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAC,qBAAqB,EAAC,MAAM,cAAc,CAAC;AACnD,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,qBAAqB,EAAC,MAAM,cAAc,CAAC;AACnD,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC"}
|
package/lib/utils/date.d.ts
CHANGED
|
@@ -5,3 +5,19 @@ export declare const getPreviousMonth: (date: Date) => Date;
|
|
|
5
5
|
export declare const sameDate: (date1: Date, date2: Date) => boolean;
|
|
6
6
|
export declare const diffDate: (start: Date, end: Date) => number;
|
|
7
7
|
export declare const incrementDate: (date: Date, days: number) => Date;
|
|
8
|
+
declare const month: string[];
|
|
9
|
+
export declare const getDay: (date: Date, I18n: {
|
|
10
|
+
t: (key: string) => string;
|
|
11
|
+
}) => string;
|
|
12
|
+
export declare const getMonth: (date: Date, I18n: {
|
|
13
|
+
t: (key: string) => string;
|
|
14
|
+
}) => string;
|
|
15
|
+
export declare const getFullDateItems: (date: string, I18n: {
|
|
16
|
+
t: (key: string) => string;
|
|
17
|
+
}) => {
|
|
18
|
+
day: string;
|
|
19
|
+
date: number;
|
|
20
|
+
month: string;
|
|
21
|
+
year: number;
|
|
22
|
+
};
|
|
23
|
+
export {};
|
package/lib/utils/date.js
CHANGED
|
@@ -54,4 +54,45 @@ export const diffDate = (start, end) => {
|
|
|
54
54
|
export const incrementDate = (date, days) => {
|
|
55
55
|
return new Date(date.getFullYear(), date.getMonth(), date.getDate() + days);
|
|
56
56
|
};
|
|
57
|
+
const dayOfWeek = [
|
|
58
|
+
'Base_Day_Sun',
|
|
59
|
+
'Base_Day_Mon',
|
|
60
|
+
'Base_Day_Tue',
|
|
61
|
+
'Base_Day_Wed',
|
|
62
|
+
'Base_Day_Thu',
|
|
63
|
+
'Base_Day_Fri',
|
|
64
|
+
'Base_Day_Sat',
|
|
65
|
+
];
|
|
66
|
+
const month = [
|
|
67
|
+
'Base_Month_Jan',
|
|
68
|
+
'Base_Month_Feb',
|
|
69
|
+
'Base_Month_Mar',
|
|
70
|
+
'Base_Month_Apr',
|
|
71
|
+
'Base_Month_May',
|
|
72
|
+
'Base_Month_Jun',
|
|
73
|
+
'Base_Month_Jul',
|
|
74
|
+
'Base_Month_Aug',
|
|
75
|
+
'Base_Month_Sep',
|
|
76
|
+
'Base_Month_Oct',
|
|
77
|
+
'Base_Month_Nov',
|
|
78
|
+
'Base_Month_Dec',
|
|
79
|
+
];
|
|
80
|
+
export const getDay = (date, I18n) => {
|
|
81
|
+
return I18n.t(dayOfWeek[date.getDay()]);
|
|
82
|
+
};
|
|
83
|
+
export const getMonth = (date, I18n) => {
|
|
84
|
+
return I18n.t(month[date.getMonth()]);
|
|
85
|
+
};
|
|
86
|
+
export const getFullDateItems = (date, I18n) => {
|
|
87
|
+
if (date == null) {
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
const _date = new Date(date);
|
|
91
|
+
return {
|
|
92
|
+
day: getDay(_date, I18n),
|
|
93
|
+
date: _date.getDate(),
|
|
94
|
+
month: getMonth(_date, I18n),
|
|
95
|
+
year: _date.getFullYear(),
|
|
96
|
+
};
|
|
97
|
+
};
|
|
57
98
|
//# sourceMappingURL=date.js.map
|
package/lib/utils/date.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date.js","sourceRoot":"","sources":["../../src/utils/date.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,IAAY,EAAW,EAAE;IAC9C,OAAO,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;AACvD,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,IAAY,EAAW,EAAE;IAClD,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,MAAM,GAAG,EAAE,CAAC;AAC3C,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,IAAU,EAAQ,EAAE;IAC/C,IAAI,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE;QAC1B,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,CAAC,EAAE,CAAC,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,GAAG;IACZ,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;CACjB,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAG,CACpB,IAAU,EACV,IAAkC,EAC1B,EAAE;IACV,OAAO,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;AAC1C,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,IAAU,EACV,IAAkC,EAC1B,EAAE;IACV,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;AACxC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,IAAY,EACZ,IAAkC,EACwB,EAAE;IAC5D,IAAI,IAAI,IAAI,IAAI,EAAE;QAChB,OAAO,IAAI,CAAC;KACb;IAED,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC;IAE7B,OAAO;QACL,GAAG,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC;QACxB,IAAI,EAAE,KAAK,CAAC,OAAO,EAAE;QACrB,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC;QAC5B,IAAI,EAAE,KAAK,CAAC,WAAW,EAAE;KAC1B,CAAC;AACJ,CAAC,CAAC"}
|
package/lib/utils/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { updateAgendaItems } from './agenda';
|
|
2
|
-
export { isDate, isDateTime, getNextMonth, getPreviousMonth, diffDate, sameDate, incrementDate, } from './date';
|
|
2
|
+
export { isDate, isDateTime, getNextMonth, getPreviousMonth, diffDate, sameDate, incrementDate, getDay, getMonth, getFullDateItems, } from './date';
|
|
3
3
|
export { displayItemName } from './displayers';
|
|
4
4
|
export { formatDate, formatDateTime, formatTime, formatScan, formatURL, } from './formatters';
|
|
5
5
|
export { useBinaryImageUri, useBinaryPictureUri, useMetafileUri } from './image';
|
package/lib/utils/index.js
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
18
|
export { updateAgendaItems } from './agenda';
|
|
19
|
-
export { isDate, isDateTime, getNextMonth, getPreviousMonth, diffDate, sameDate, incrementDate, } from './date';
|
|
19
|
+
export { isDate, isDateTime, getNextMonth, getPreviousMonth, diffDate, sameDate, incrementDate, getDay, getMonth, getFullDateItems, } from './date';
|
|
20
20
|
export { displayItemName } from './displayers';
|
|
21
21
|
export { formatDate, formatDateTime, formatTime, formatScan, formatURL, } from './formatters';
|
|
22
22
|
export { useBinaryImageUri, useBinaryPictureUri, useMetafileUri } from './image';
|
package/lib/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,iBAAiB,EAAC,MAAM,UAAU,CAAC;AAC3C,OAAO,EACL,MAAM,EACN,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,QAAQ,EACR,QAAQ,EACR,aAAa,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,iBAAiB,EAAC,MAAM,UAAU,CAAC;AAC3C,OAAO,EACL,MAAM,EACN,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,QAAQ,EACR,QAAQ,EACR,aAAa,EACb,MAAM,EACN,QAAQ,EACR,gBAAgB,GACjB,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAC,eAAe,EAAC,MAAM,cAAc,CAAC;AAC7C,OAAO,EACL,UAAU,EACV,cAAc,EACd,UAAU,EACV,UAAU,EACV,SAAS,GACV,MAAM,cAAc,CAAC;AACtB,OAAO,EAAC,iBAAiB,EAAE,mBAAmB,EAAE,cAAc,EAAC,MAAM,SAAS,CAAC;AAC/E,OAAO,EAAC,UAAU,EAAE,iBAAiB,EAAC,MAAM,QAAQ,CAAC;AACrD,OAAO,EACL,aAAa,EACb,cAAc,EACd,eAAe,EACf,cAAc,GACf,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,gBAAgB,EAChB,OAAO,EACP,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,aAAa,GACd,MAAM,UAAU,CAAC;AAClB,OAAO,EAAC,gBAAgB,EAAC,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAC,eAAe,EAAE,MAAM,EAAE,UAAU,EAAE,cAAc,EAAC,MAAM,UAAU,CAAC;AAC7E,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axelor/aos-mobile-core",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.5",
|
|
4
4
|
"author": "Axelor",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"publishConfig": {
|
|
@@ -31,19 +31,21 @@
|
|
|
31
31
|
"react": "18.2.0",
|
|
32
32
|
"react-i18next": "^11.18.6",
|
|
33
33
|
"react-native": "0.68.1",
|
|
34
|
+
"react-native-contacts": "^7.0.6",
|
|
34
35
|
"react-native-datawedge-intents": "^0.1.8",
|
|
35
36
|
"react-native-date-picker": "^4.2.6",
|
|
36
37
|
"react-native-device-info": "^10.3.0",
|
|
37
38
|
"react-native-document-picker": "8.1.3",
|
|
38
39
|
"react-native-file-viewer": "^2.1.5",
|
|
39
40
|
"react-native-fs": "^2.20.0",
|
|
40
|
-
"react-native-gesture-handler": "2.
|
|
41
|
+
"react-native-gesture-handler": "2.9.0",
|
|
41
42
|
"react-native-mmkv": "2.4.3",
|
|
42
43
|
"react-native-safe-area-context": "4.2.4",
|
|
43
44
|
"react-native-screens": "3.13.1",
|
|
44
45
|
"react-native-static-safe-area-insets": "^2.2.0",
|
|
45
46
|
"react-native-toast-message": "^2.1.5",
|
|
46
|
-
"react-native-
|
|
47
|
+
"react-native-vector-icons": "^9.2.0",
|
|
48
|
+
"react-native-vision-camera": "2.15.6",
|
|
47
49
|
"rn-fetch-blob": "0.13.0-beta.1",
|
|
48
50
|
"vision-camera-code-scanner": "^0.2.0"
|
|
49
51
|
},
|
|
@@ -51,7 +53,7 @@
|
|
|
51
53
|
"@babel/runtime": "^7.19.0",
|
|
52
54
|
"@react-native-clipboard/clipboard": "^1.11.1",
|
|
53
55
|
"@react-native-community/eslint-config": "^2.0.0",
|
|
54
|
-
"@types/react": "18.0
|
|
56
|
+
"@types/react": "18.2.0",
|
|
55
57
|
"@types/react-i18next": "^8.1.0",
|
|
56
58
|
"@types/react-native": "0.68.1",
|
|
57
59
|
"axios": "^0.26.1",
|
|
@@ -63,27 +65,27 @@
|
|
|
63
65
|
"prettier": "^2.7.1",
|
|
64
66
|
"react": "18.2.0",
|
|
65
67
|
"react-i18next": "^11.18.6",
|
|
66
|
-
"react-native": "0.68.1",
|
|
67
68
|
"react-native-datawedge-intents": "^0.1.8",
|
|
68
69
|
"react-native-date-picker": "^4.2.6",
|
|
69
70
|
"react-native-device-info": "^10.3.0",
|
|
70
71
|
"react-native-document-picker": "8.1.3",
|
|
71
72
|
"react-native-file-viewer": "^2.1.5",
|
|
72
73
|
"react-native-fs": "^2.20.0",
|
|
73
|
-
"react-native-gesture-handler": "2.
|
|
74
|
+
"react-native-gesture-handler": "2.9.0",
|
|
74
75
|
"react-native-mmkv": "2.4.3",
|
|
75
76
|
"react-native-reanimated": "2.10.0",
|
|
76
77
|
"react-native-safe-area-context": "4.2.4",
|
|
77
78
|
"react-native-screens": "3.13.1",
|
|
78
79
|
"react-native-static-safe-area-insets": "^2.2.0",
|
|
79
80
|
"react-native-toast-message": "^2.1.5",
|
|
80
|
-
"react-native-
|
|
81
|
+
"react-native-vector-icons": "^9.2.0",
|
|
82
|
+
"react-native-vision-camera": "2.15.6",
|
|
81
83
|
"rn-fetch-blob": "0.13.0-beta.1",
|
|
82
84
|
"vision-camera-code-scanner": "^0.2.0"
|
|
83
85
|
},
|
|
84
86
|
"dependencies": {
|
|
85
|
-
"@axelor/aos-mobile-error": "7.0.
|
|
86
|
-
"@axelor/aos-mobile-ui": "7.0.
|
|
87
|
+
"@axelor/aos-mobile-error": "7.0.5",
|
|
88
|
+
"@axelor/aos-mobile-ui": "7.0.5",
|
|
87
89
|
"@react-navigation/drawer": "6.6.3",
|
|
88
90
|
"@react-navigation/native": "6.1.7",
|
|
89
91
|
"@react-navigation/native-stack": "6.9.13",
|
|
@@ -97,7 +99,7 @@
|
|
|
97
99
|
"yup": "^1.0.2"
|
|
98
100
|
},
|
|
99
101
|
"resolutions": {
|
|
100
|
-
"@types/react": "18.0
|
|
102
|
+
"@types/react": "18.2.0",
|
|
101
103
|
"react-native-reanimated": "2.10.0"
|
|
102
104
|
}
|
|
103
105
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorText.js","sourceRoot":"","sources":["../../../../src/components/molecules/ErrorText/ErrorText.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAC,aAAa,EAAC,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AAExC,MAAM,gBAAgB,GAAG,SAAS,CAAC;AACnC,MAAM,WAAW,GAAG,GAAG,CAAC;AACxB,MAAM,SAAS,GAAG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G,MAAM,CAAC,EAAE,CACzB,UAAU,CAAC,MAAM,CAAC;IAChB,SAAS,EAAE;QACT,UAAU,EAAE,QAAQ;KACrB;IACD,MAAM,EAAE;QACN,SAAS,EAAE,EAAE;QACb,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,EAAE;QACV,SAAS,EAAE,CAAC;QACZ,aAAa,EAAE,GAAG;QAClB,WAAW,EAAE,MAAM,CAAC,cAAc,CAAC,UAAU;QAC7C,YAAY,EAAE,EAAC,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAC;KACpC;CACF,CAAC,CAAC;AAEL,eAAe,WAAW,CAAC"}
|
|
@@ -1,44 +0,0 @@
|
|
|
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 React, { useMemo } from 'react';
|
|
19
|
-
import { Dimensions, StyleSheet, View } from 'react-native';
|
|
20
|
-
import { Text, useThemeColor } from '@axelor/aos-mobile-ui';
|
|
21
|
-
const SessionNumberIndicator = ({ number }) => {
|
|
22
|
-
const Colors = useThemeColor();
|
|
23
|
-
const styles = useMemo(() => getStyles(Colors), [Colors]);
|
|
24
|
-
return (<View style={styles.bubble}>
|
|
25
|
-
<Text>{number}</Text>
|
|
26
|
-
</View>);
|
|
27
|
-
};
|
|
28
|
-
const getStyles = (Colors) => StyleSheet.create({
|
|
29
|
-
bubble: {
|
|
30
|
-
alignSelf: 'center',
|
|
31
|
-
justifyContent: 'center',
|
|
32
|
-
alignItems: 'center',
|
|
33
|
-
backgroundColor: Colors.secondaryColor_dark.foreground,
|
|
34
|
-
borderWidth: 2,
|
|
35
|
-
borderColor: Colors.infoColor.background_light,
|
|
36
|
-
borderRadius: Dimensions.get('window').width * 0.07,
|
|
37
|
-
width: Dimensions.get('window').width * 0.07,
|
|
38
|
-
height: Dimensions.get('window').width * 0.07,
|
|
39
|
-
position: 'absolute',
|
|
40
|
-
left: '-10%',
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
export default SessionNumberIndicator;
|
|
44
|
-
//# sourceMappingURL=SessionNumberIndicator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SessionNumberIndicator.js","sourceRoot":"","sources":["../../../../src/components/molecules/SessionNumberIndicator/SessionNumberIndicator.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,EAAC,UAAU,EAAE,UAAU,EAAE,IAAI,EAAC,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAC,IAAI,EAAe,aAAa,EAAC,MAAM,uBAAuB,CAAC;AAEvE,MAAM,sBAAsB,GAAG,CAAC,EAAC,MAAM,EAAC,EAAE,EAAE;IAC1C,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;IAE/B,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAE1D,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CACzB;MAAA,CAAC,IAAI,CAAC,CAAC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MAAM;KACf;CACF,CAAC,CAAC;AAEH,KAAK,UAAU,0BAA0B,CAAC,GAAG,EAAE,QAAQ;IACrD,IAAI,eAAe,CAAC,GAAG,CAAC,EAAE;QACxB,OAAO,IAAI,CAAC;KACb;IACD,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;SAC5B,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC;SACtB,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAEnB,IAAI,IAAI,IAAI,IAAI,EAAE;QAChB,OAAO,IAAI,CAAC;KACb;IAED,OAAO,EAAC,GAAG,EAAE,GAAG,IAAI,QAAQ,QAAQ,EAAE,EAAC,CAAC;AAC1C,CAAC;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PasswordInput.js","sourceRoot":"","sources":["../../../../src/components/organisms/PasswordInput/PasswordInput.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EACL,eAAe,EACf,IAAI,EACJ,SAAS,EACT,aAAa,GACd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,aAAa,MAAM,oCAAoC,CAAC;AAC/D,OAAO,EAAC,eAAe,EAAC,MAAM,gBAAgB,CAAC;AAE/C,MAAM,aAAa,GAAG,CAAC,EACrB,KAAK,EACL,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,kBAAkB,GAAG,KAAK,GAC3B,EAAE,EAAE;IACH,MAAM,IAAI,GAAG,aAAa,EAAE,CAAC;IAC7B,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;IAE/B,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE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,CAAC;AAEH,eAAe,aAAa,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export declare const CreateSessionButton: ({ onPress, numberSessions }: {
|
|
2
|
-
onPress: any;
|
|
3
|
-
numberSessions: any;
|
|
4
|
-
}) => JSX.Element;
|
|
5
|
-
export declare const ChooseSessionButton: ({ onPress, numberSessions, sessionActive, }: {
|
|
6
|
-
onPress: any;
|
|
7
|
-
numberSessions: any;
|
|
8
|
-
sessionActive: any;
|
|
9
|
-
}) => JSX.Element;
|
|
10
|
-
export declare const NoActiveSessionButton: ({ numberSessions, sessionActive }: {
|
|
11
|
-
numberSessions: any;
|
|
12
|
-
sessionActive: any;
|
|
13
|
-
}) => JSX.Element;
|
|
14
|
-
export declare const ConnectSessionButton: ({ onPress, sessionActive }: {
|
|
15
|
-
onPress: any;
|
|
16
|
-
sessionActive: any;
|
|
17
|
-
}) => JSX.Element;
|