@axelor/aos-mobile-core 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +310 -0
- package/lib/api/attached-files-api.d.ts +8 -0
- package/lib/api/attached-files-api.js +51 -0
- package/lib/api/attached-files-api.js.map +1 -0
- package/lib/api/login-api.d.ts +5 -0
- package/lib/api/login-api.js +41 -0
- package/lib/api/login-api.js.map +1 -0
- package/lib/api/mail-message-api.d.ts +43 -0
- package/lib/api/mail-message-api.js +114 -0
- package/lib/api/mail-message-api.js.map +1 -0
- package/lib/api/menu-config-api.d.ts +5 -0
- package/lib/api/menu-config-api.js +68 -0
- package/lib/api/menu-config-api.js.map +1 -0
- package/lib/api/metafile-api.d.ts +6 -0
- package/lib/api/metafile-api.js +50 -0
- package/lib/api/metafile-api.js.map +1 -0
- package/lib/api/mobile-config-api.d.ts +1 -0
- package/lib/api/mobile-config-api.js +31 -0
- package/lib/api/mobile-config-api.js.map +1 -0
- package/lib/api/net-info-utils.d.ts +5 -0
- package/lib/api/net-info-utils.js +29 -0
- package/lib/api/net-info-utils.js.map +1 -0
- package/lib/api/traceback-api.d.ts +7 -0
- package/lib/api/traceback-api.js +35 -0
- package/lib/api/traceback-api.js.map +1 -0
- package/lib/api/utils.d.ts +25 -0
- package/lib/api/utils.js +92 -0
- package/lib/api/utils.js.map +1 -0
- package/lib/app/Application.d.ts +15 -0
- package/lib/app/Application.js +29 -0
- package/lib/app/Application.js.map +1 -0
- package/lib/app/ContextedApplication.d.ts +9 -0
- package/lib/app/ContextedApplication.js +80 -0
- package/lib/app/ContextedApplication.js.map +1 -0
- package/lib/app/ContextsProvider.d.ts +14 -0
- package/lib/app/ContextsProvider.js +63 -0
- package/lib/app/ContextsProvider.js.map +1 -0
- package/lib/app/Module.d.ts +26 -0
- package/lib/app/Module.js +19 -0
- package/lib/app/Module.js.map +1 -0
- package/lib/app/RootNavigator.d.ts +7 -0
- package/lib/app/RootNavigator.js +69 -0
- package/lib/app/RootNavigator.js.map +1 -0
- package/lib/app/index.d.ts +5 -0
- package/lib/app/index.js +22 -0
- package/lib/app/index.js.map +1 -0
- package/lib/assets/Logo_Axelor.png +0 -0
- package/lib/auth/api/company-api.d.ts +1 -0
- package/lib/auth/api/company-api.js +31 -0
- package/lib/auth/api/company-api.js.map +1 -0
- package/lib/auth/api/config-api.d.ts +2 -0
- package/lib/auth/api/config-api.js +45 -0
- package/lib/auth/api/config-api.js.map +1 -0
- package/lib/auth/api/index.d.ts +4 -0
- package/lib/auth/api/index.js +22 -0
- package/lib/auth/api/index.js.map +1 -0
- package/lib/auth/api/language-api.d.ts +1 -0
- package/lib/auth/api/language-api.js +24 -0
- package/lib/auth/api/language-api.js.map +1 -0
- package/lib/auth/api/user-api.d.ts +2 -0
- package/lib/auth/api/user-api.js +30 -0
- package/lib/auth/api/user-api.js.map +1 -0
- package/lib/auth/features/asyncFunctionsIndex.d.ts +4 -0
- package/lib/auth/features/asyncFunctionsIndex.js +22 -0
- package/lib/auth/features/asyncFunctionsIndex.js.map +1 -0
- package/lib/auth/features/companySlice.d.ts +14 -0
- package/lib/auth/features/companySlice.js +48 -0
- package/lib/auth/features/companySlice.js.map +1 -0
- package/lib/auth/features/configSlice.d.ts +37 -0
- package/lib/auth/features/configSlice.js +82 -0
- package/lib/auth/features/configSlice.js.map +1 -0
- package/lib/auth/features/index.d.ts +4 -0
- package/lib/auth/features/index.js +22 -0
- package/lib/auth/features/index.js.map +1 -0
- package/lib/auth/features/languageSlice.d.ts +14 -0
- package/lib/auth/features/languageSlice.js +48 -0
- package/lib/auth/features/languageSlice.js.map +1 -0
- package/lib/auth/features/userSlice.d.ts +27 -0
- package/lib/auth/features/userSlice.js +83 -0
- package/lib/auth/features/userSlice.js.map +1 -0
- package/lib/auth/i18n/en.json +23 -0
- package/lib/auth/i18n/fr.json +23 -0
- package/lib/auth/index.d.ts +5 -0
- package/lib/auth/index.js +55 -0
- package/lib/auth/index.js.map +1 -0
- package/lib/auth/screens/SettingsScreen.d.ts +4 -0
- package/lib/auth/screens/SettingsScreen.js +79 -0
- package/lib/auth/screens/SettingsScreen.js.map +1 -0
- package/lib/auth/screens/UserScreen.d.ts +5 -0
- package/lib/auth/screens/UserScreen.js +116 -0
- package/lib/auth/screens/UserScreen.js.map +1 -0
- package/lib/auth/screens/index.d.ts +2 -0
- package/lib/auth/screens/index.js +20 -0
- package/lib/auth/screens/index.js.map +1 -0
- package/lib/axios/AxiosApi.d.ts +12 -0
- package/lib/axios/AxiosApi.js +32 -0
- package/lib/axios/AxiosApi.js.map +1 -0
- package/lib/components/external/Camera/Camera.d.ts +2 -0
- package/lib/components/external/Camera/Camera.js +148 -0
- package/lib/components/external/Camera/Camera.js.map +1 -0
- package/lib/components/external/Camera/CaptureButton.d.ts +10 -0
- package/lib/components/external/Camera/CaptureButton.js +118 -0
- package/lib/components/external/Camera/CaptureButton.js.map +1 -0
- package/lib/components/external/CameraScanner/CameraScanner.d.ts +10 -0
- package/lib/components/external/CameraScanner/CameraScanner.js +87 -0
- package/lib/components/external/CameraScanner/CameraScanner.js.map +1 -0
- package/lib/components/external/PlanningView/PlanningView.d.ts +11 -0
- package/lib/components/external/PlanningView/PlanningView.js +123 -0
- package/lib/components/external/PlanningView/PlanningView.js.map +1 -0
- package/lib/components/external/PlanningView/agenda.helpers.d.ts +10 -0
- package/lib/components/external/PlanningView/agenda.helpers.js +90 -0
- package/lib/components/external/PlanningView/agenda.helpers.js.map +1 -0
- package/lib/components/external/Scanner/Scanner.d.ts +2 -0
- package/lib/components/external/Scanner/Scanner.js +67 -0
- package/lib/components/external/Scanner/Scanner.js.map +1 -0
- package/lib/components/external/Stopwatch/Stopwatch.d.ts +18 -0
- package/lib/components/external/Stopwatch/Stopwatch.js +114 -0
- package/lib/components/external/Stopwatch/Stopwatch.js.map +1 -0
- package/lib/components/external/Timer/Timer.d.ts +9 -0
- package/lib/components/external/Timer/Timer.js +60 -0
- package/lib/components/external/Timer/Timer.js.map +1 -0
- package/lib/components/external/index.d.ts +6 -0
- package/lib/components/external/index.js +24 -0
- package/lib/components/external/index.js.map +1 -0
- package/lib/components/index.d.ts +4 -0
- package/lib/components/index.js +22 -0
- package/lib/components/index.js.map +1 -0
- package/lib/components/molecules/ErrorText/ErrorText.d.ts +4 -0
- package/lib/components/molecules/ErrorText/ErrorText.js +31 -0
- package/lib/components/molecules/ErrorText/ErrorText.js.map +1 -0
- package/lib/components/molecules/HeaderOptionsMenuItem/HeaderOptionMenuItem.d.ts +9 -0
- package/lib/components/molecules/HeaderOptionsMenuItem/HeaderOptionMenuItem.js +56 -0
- package/lib/components/molecules/HeaderOptionsMenuItem/HeaderOptionMenuItem.js.map +1 -0
- package/lib/components/molecules/IconSettings/IconSettings.d.ts +4 -0
- package/lib/components/molecules/IconSettings/IconSettings.js +31 -0
- package/lib/components/molecules/IconSettings/IconSettings.js.map +1 -0
- package/lib/components/molecules/InputBarCodeCard/InputBarCodeCard.d.ts +7 -0
- package/lib/components/molecules/InputBarCodeCard/InputBarCodeCard.js +84 -0
- package/lib/components/molecules/InputBarCodeCard/InputBarCodeCard.js.map +1 -0
- package/lib/components/molecules/LoginButton/LoginButton.d.ts +4 -0
- package/lib/components/molecules/LoginButton/LoginButton.js +40 -0
- package/lib/components/molecules/LoginButton/LoginButton.js.map +1 -0
- package/lib/components/molecules/MailMessageReadIcon/MailMessageReadIcon.d.ts +7 -0
- package/lib/components/molecules/MailMessageReadIcon/MailMessageReadIcon.js +55 -0
- package/lib/components/molecules/MailMessageReadIcon/MailMessageReadIcon.js.map +1 -0
- package/lib/components/molecules/TrackItem/TrackItem.d.ts +9 -0
- package/lib/components/molecules/TrackItem/TrackItem.js +65 -0
- package/lib/components/molecules/TrackItem/TrackItem.js.map +1 -0
- package/lib/components/molecules/index.d.ts +7 -0
- package/lib/components/molecules/index.js +25 -0
- package/lib/components/molecules/index.js.map +1 -0
- package/lib/components/organisms/AOSImage/AOSImage.d.ts +15 -0
- package/lib/components/organisms/AOSImage/AOSImage.js +37 -0
- package/lib/components/organisms/AOSImage/AOSImage.js.map +1 -0
- package/lib/components/organisms/AOSImageBubble/AOSImageBubble.d.ts +9 -0
- package/lib/components/organisms/AOSImageBubble/AOSImageBubble.js +30 -0
- package/lib/components/organisms/AOSImageBubble/AOSImageBubble.js.map +1 -0
- package/lib/components/organisms/HeaderOptionsMenu/HeaderOptionsMenu.d.ts +9 -0
- package/lib/components/organisms/HeaderOptionsMenu/HeaderOptionsMenu.js +68 -0
- package/lib/components/organisms/HeaderOptionsMenu/HeaderOptionsMenu.js.map +1 -0
- package/lib/components/organisms/LogoImage/LogoImage.d.ts +4 -0
- package/lib/components/organisms/LogoImage/LogoImage.js +52 -0
- package/lib/components/organisms/LogoImage/LogoImage.js.map +1 -0
- package/lib/components/organisms/MailMessageCard/MailMessageCard.d.ts +17 -0
- package/lib/components/organisms/MailMessageCard/MailMessageCard.js +79 -0
- package/lib/components/organisms/MailMessageCard/MailMessageCard.js.map +1 -0
- package/lib/components/organisms/MailMessageCommentCard/MailMessageCommentCard.d.ts +12 -0
- package/lib/components/organisms/MailMessageCommentCard/MailMessageCommentCard.js +139 -0
- package/lib/components/organisms/MailMessageCommentCard/MailMessageCommentCard.js.map +1 -0
- package/lib/components/organisms/MailMessageNotificationCard/MailMessageNotificationCard.d.ts +15 -0
- package/lib/components/organisms/MailMessageNotificationCard/MailMessageNotificationCard.js +79 -0
- package/lib/components/organisms/MailMessageNotificationCard/MailMessageNotificationCard.js.map +1 -0
- package/lib/components/organisms/PasswordInput/PasswordInput.d.ts +7 -0
- package/lib/components/organisms/PasswordInput/PasswordInput.js +36 -0
- package/lib/components/organisms/PasswordInput/PasswordInput.js.map +1 -0
- package/lib/components/organisms/ScannerAutocompleteSearch/ScannerAutocompleteSearch.d.ts +17 -0
- package/lib/components/organisms/ScannerAutocompleteSearch/ScannerAutocompleteSearch.js +68 -0
- package/lib/components/organisms/ScannerAutocompleteSearch/ScannerAutocompleteSearch.js.map +1 -0
- package/lib/components/organisms/UrlInput/UrlInput.d.ts +10 -0
- package/lib/components/organisms/UrlInput/UrlInput.js +38 -0
- package/lib/components/organisms/UrlInput/UrlInput.js.map +1 -0
- package/lib/components/organisms/UsernameInput/UsernameInput.d.ts +6 -0
- package/lib/components/organisms/UsernameInput/UsernameInput.js +33 -0
- package/lib/components/organisms/UsernameInput/UsernameInput.js.map +1 -0
- package/lib/components/organisms/index.d.ts +11 -0
- package/lib/components/organisms/index.js +29 -0
- package/lib/components/organisms/index.js.map +1 -0
- package/lib/components/templates/AttachedFilesView/AttachedFilesView.d.ts +10 -0
- package/lib/components/templates/AttachedFilesView/AttachedFilesView.js +87 -0
- package/lib/components/templates/AttachedFilesView/AttachedFilesView.js.map +1 -0
- package/lib/components/templates/MailMessageView/MailMessageView.d.ts +6 -0
- package/lib/components/templates/MailMessageView/MailMessageView.js +140 -0
- package/lib/components/templates/MailMessageView/MailMessageView.js.map +1 -0
- package/lib/components/templates/index.d.ts +2 -0
- package/lib/components/templates/index.js +20 -0
- package/lib/components/templates/index.js.map +1 -0
- package/lib/features/attachedFilesSlice.d.ts +35 -0
- package/lib/features/attachedFilesSlice.js +82 -0
- package/lib/features/attachedFilesSlice.js.map +1 -0
- package/lib/features/authSlice.d.ts +44 -0
- package/lib/features/authSlice.js +67 -0
- package/lib/features/authSlice.js.map +1 -0
- package/lib/features/cameraSlice.d.ts +14 -0
- package/lib/features/cameraSlice.js +52 -0
- package/lib/features/cameraSlice.js.map +1 -0
- package/lib/features/index.d.ts +8 -0
- package/lib/features/index.js +26 -0
- package/lib/features/index.js.map +1 -0
- package/lib/features/mailMessageSlice.d.ts +97 -0
- package/lib/features/mailMessageSlice.js +219 -0
- package/lib/features/mailMessageSlice.js.map +1 -0
- package/lib/features/menuConfigSlice.d.ts +14 -0
- package/lib/features/menuConfigSlice.js +48 -0
- package/lib/features/menuConfigSlice.js.map +1 -0
- package/lib/features/metafileSlice.d.ts +14 -0
- package/lib/features/metafileSlice.js +48 -0
- package/lib/features/metafileSlice.js.map +1 -0
- package/lib/features/mobileConfigSlice.d.ts +14 -0
- package/lib/features/mobileConfigSlice.js +52 -0
- package/lib/features/mobileConfigSlice.js.map +1 -0
- package/lib/features/scannerSlice.d.ts +14 -0
- package/lib/features/scannerSlice.js +52 -0
- package/lib/features/scannerSlice.js.map +1 -0
- package/lib/hooks/use-effect-debugger.d.ts +1 -0
- package/lib/hooks/use-effect-debugger.js +47 -0
- package/lib/hooks/use-effect-debugger.js.map +1 -0
- package/lib/i18n/api/translation.d.ts +2 -0
- package/lib/i18n/api/translation.js +38 -0
- package/lib/i18n/api/translation.js.map +1 -0
- package/lib/i18n/component/Translator.d.ts +6 -0
- package/lib/i18n/component/Translator.js +74 -0
- package/lib/i18n/component/Translator.js.map +1 -0
- package/lib/i18n/helpers/langages.d.ts +3 -0
- package/lib/i18n/helpers/langages.js +34 -0
- package/lib/i18n/helpers/langages.js.map +1 -0
- package/lib/i18n/helpers/translations.d.ts +1 -0
- package/lib/i18n/helpers/translations.js +24 -0
- package/lib/i18n/helpers/translations.js.map +1 -0
- package/lib/i18n/hooks/use-translator.d.ts +5 -0
- package/lib/i18n/hooks/use-translator.js +24 -0
- package/lib/i18n/hooks/use-translator.js.map +1 -0
- package/lib/i18n/i18n.d.ts +20 -0
- package/lib/i18n/i18n.js +53 -0
- package/lib/i18n/i18n.js.map +1 -0
- package/lib/i18n/index.d.ts +4 -0
- package/lib/i18n/index.js +22 -0
- package/lib/i18n/index.js.map +1 -0
- package/lib/i18n/translations/en.json +52 -0
- package/lib/i18n/translations/fr.json +52 -0
- package/lib/index.d.ts +18 -0
- package/lib/index.js +36 -0
- package/lib/index.js.map +1 -0
- package/lib/navigator/Navigator.d.ts +12 -0
- package/lib/navigator/Navigator.js +118 -0
- package/lib/navigator/Navigator.js.map +1 -0
- package/lib/navigator/drawer/AuthMenuIconButton.d.ts +6 -0
- package/lib/navigator/drawer/AuthMenuIconButton.js +29 -0
- package/lib/navigator/drawer/AuthMenuIconButton.js.map +1 -0
- package/lib/navigator/drawer/BackIcon.d.ts +4 -0
- package/lib/navigator/drawer/BackIcon.js +32 -0
- package/lib/navigator/drawer/BackIcon.js.map +1 -0
- package/lib/navigator/drawer/DrawerContent.d.ts +8 -0
- package/lib/navigator/drawer/DrawerContent.js +177 -0
- package/lib/navigator/drawer/DrawerContent.js.map +1 -0
- package/lib/navigator/drawer/DrawerToggleButton.d.ts +4 -0
- package/lib/navigator/drawer/DrawerToggleButton.js +32 -0
- package/lib/navigator/drawer/DrawerToggleButton.js.map +1 -0
- package/lib/navigator/drawer/Menu.d.ts +8 -0
- package/lib/navigator/drawer/Menu.js +91 -0
- package/lib/navigator/drawer/Menu.js.map +1 -0
- package/lib/navigator/drawer/MenuIconButton.d.ts +10 -0
- package/lib/navigator/drawer/MenuIconButton.js +64 -0
- package/lib/navigator/drawer/MenuIconButton.js.map +1 -0
- package/lib/navigator/drawer/MenuItem.d.ts +8 -0
- package/lib/navigator/drawer/MenuItem.js +71 -0
- package/lib/navigator/drawer/MenuItem.js.map +1 -0
- package/lib/navigator/menu.helper.d.ts +8 -0
- package/lib/navigator/menu.helper.js +50 -0
- package/lib/navigator/menu.helper.js.map +1 -0
- package/lib/navigator/module.helper.d.ts +7 -0
- package/lib/navigator/module.helper.js +95 -0
- package/lib/navigator/module.helper.js.map +1 -0
- package/lib/navigator/roles.helper.d.ts +4 -0
- package/lib/navigator/roles.helper.js +33 -0
- package/lib/navigator/roles.helper.js.map +1 -0
- package/lib/redux/hooks.d.ts +5 -0
- package/lib/redux/hooks.js +25 -0
- package/lib/redux/hooks.js.map +1 -0
- package/lib/redux/store.d.ts +1 -0
- package/lib/redux/store.js +28 -0
- package/lib/redux/store.js.map +1 -0
- package/lib/screens/AttachedFilesScreen.d.ts +5 -0
- package/lib/screens/AttachedFilesScreen.js +26 -0
- package/lib/screens/AttachedFilesScreen.js.map +1 -0
- package/lib/screens/ErrorScreen.d.ts +5 -0
- package/lib/screens/ErrorScreen.js +46 -0
- package/lib/screens/ErrorScreen.js.map +1 -0
- package/lib/screens/LoginScreen.d.ts +4 -0
- package/lib/screens/LoginScreen.js +115 -0
- package/lib/screens/LoginScreen.js.map +1 -0
- package/lib/screens/MailMessageScreen.d.ts +5 -0
- package/lib/screens/MailMessageScreen.js +25 -0
- package/lib/screens/MailMessageScreen.js.map +1 -0
- package/lib/storage/Storage.d.ts +17 -0
- package/lib/storage/Storage.js +53 -0
- package/lib/storage/Storage.js.map +1 -0
- package/lib/tools/ClipboardProvider.d.ts +7 -0
- package/lib/tools/ClipboardProvider.js +59 -0
- package/lib/tools/ClipboardProvider.js.map +1 -0
- package/lib/tools/FileViewer.d.ts +13 -0
- package/lib/tools/FileViewer.js +48 -0
- package/lib/tools/FileViewer.js.map +1 -0
- package/lib/tools/LinkingProvider.d.ts +17 -0
- package/lib/tools/LinkingProvider.js +94 -0
- package/lib/tools/LinkingProvider.js.map +1 -0
- package/lib/tools/index.d.ts +3 -0
- package/lib/tools/index.js +21 -0
- package/lib/tools/index.js.map +1 -0
- package/lib/tools/linking.helper.d.ts +25 -0
- package/lib/tools/linking.helper.js +70 -0
- package/lib/tools/linking.helper.js.map +1 -0
- package/lib/types/index.d.ts +2 -0
- package/lib/types/index.js +20 -0
- package/lib/types/index.js.map +1 -0
- package/lib/types/mail-message-notification-type.d.ts +12 -0
- package/lib/types/mail-message-notification-type.js +48 -0
- package/lib/types/mail-message-notification-type.js.map +1 -0
- package/lib/types/stopwatch-type.d.ts +14 -0
- package/lib/types/stopwatch-type.js +64 -0
- package/lib/types/stopwatch-type.js.map +1 -0
- package/lib/utils/agenda.d.ts +1 -0
- package/lib/utils/agenda.js +28 -0
- package/lib/utils/agenda.js.map +1 -0
- package/lib/utils/date.d.ts +4 -0
- package/lib/utils/date.js +41 -0
- package/lib/utils/date.js.map +1 -0
- package/lib/utils/displayers.d.ts +1 -0
- package/lib/utils/displayers.js +19 -0
- package/lib/utils/displayers.js.map +1 -0
- package/lib/utils/formatters.d.ts +5 -0
- package/lib/utils/formatters.js +74 -0
- package/lib/utils/formatters.js.map +1 -0
- package/lib/utils/index.d.ts +9 -0
- package/lib/utils/index.js +27 -0
- package/lib/utils/index.js.map +1 -0
- package/lib/utils/list.d.ts +3 -0
- package/lib/utils/list.js +101 -0
- package/lib/utils/list.js.map +1 -0
- package/lib/utils/object.d.ts +2 -0
- package/lib/utils/object.js +36 -0
- package/lib/utils/object.js.map +1 -0
- package/lib/utils/show-toast-message.d.ts +2 -0
- package/lib/utils/show-toast-message.js +22 -0
- package/lib/utils/show-toast-message.js.map +1 -0
- package/lib/utils/string.d.ts +4 -0
- package/lib/utils/string.js +54 -0
- package/lib/utils/string.js.map +1 -0
- package/lib/utils/time.d.ts +4 -0
- package/lib/utils/time.js +78 -0
- package/lib/utils/time.js.map +1 -0
- package/package.json +95 -0
|
@@ -0,0 +1,64 @@
|
|
|
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
|
+
class StopwatchType {
|
|
19
|
+
static status = {
|
|
20
|
+
Ready: 1,
|
|
21
|
+
InProgress: 2,
|
|
22
|
+
Paused: 3,
|
|
23
|
+
Finished: 4,
|
|
24
|
+
Canceled: 5,
|
|
25
|
+
};
|
|
26
|
+
static getStatus = (select, I18n) => {
|
|
27
|
+
if (I18n) {
|
|
28
|
+
switch (select) {
|
|
29
|
+
case this.status.Ready:
|
|
30
|
+
return I18n.t('Stopwatch_Status_Ready');
|
|
31
|
+
case this.status.InProgress:
|
|
32
|
+
return I18n.t('Stopwatch_Status_InProgress');
|
|
33
|
+
case this.status.Paused:
|
|
34
|
+
return I18n.t('Stopwatch_Status_Paused');
|
|
35
|
+
case this.status.Finished:
|
|
36
|
+
return I18n.t('Stopwatch_Status_Finished');
|
|
37
|
+
case this.status.Canceled:
|
|
38
|
+
return I18n.t('Stopwatch_Status_Canceled');
|
|
39
|
+
default:
|
|
40
|
+
console.warn(`Status provided with value ${select} is not supported by stopwatch`);
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
static getStatusBorderColor = (status, Colors) => {
|
|
46
|
+
switch (status) {
|
|
47
|
+
case this.status.Ready:
|
|
48
|
+
return Colors.secondaryColor.background;
|
|
49
|
+
case this.status.InProgress:
|
|
50
|
+
return Colors.progressColor.background;
|
|
51
|
+
case this.status.Paused:
|
|
52
|
+
return Colors.cautionColor.background;
|
|
53
|
+
case this.status.Finished:
|
|
54
|
+
return Colors.primaryColor.background;
|
|
55
|
+
case this.status.Canceled:
|
|
56
|
+
return Colors.errorColor.background;
|
|
57
|
+
default:
|
|
58
|
+
console.warn(`Status provided with value ${status} is not supported by stopwatch`);
|
|
59
|
+
return {};
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
export default StopwatchType;
|
|
64
|
+
//# sourceMappingURL=stopwatch-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stopwatch-type.js","sourceRoot":"","sources":["../../src/types/stopwatch-type.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,aAAa;IACjB,MAAM,CAAC,MAAM,GAAG;QACd,KAAK,EAAE,CAAC;QACR,UAAU,EAAE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,MAAM,CAAC,QAAQ;gBACvB,OAAO,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC;YACxC,KAAK,IAAI,CAAC,MAAM,CAAC,QAAQ;gBACvB,OAAO,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC;YACtC;gBACE,OAAO,CAAC,IAAI,CACV,8BAA8B,MAAM,gCAAgC,CACrE,CAAC;gBACF,OAAO,EAAE,CAAC;SACb;IACH,CAAC,CAAC;;AAGJ,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function updateAgendaItems(previousData: any, payload: any): any;
|
|
@@ -0,0 +1,28 @@
|
|
|
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 function updateAgendaItems(previousData, payload) {
|
|
19
|
+
if (payload == null) {
|
|
20
|
+
return previousData;
|
|
21
|
+
}
|
|
22
|
+
const allData = [...previousData, ...payload];
|
|
23
|
+
const mapIdToItem = allData.map(item => [item.id, item]);
|
|
24
|
+
const mapWithoutDuplicates = new Map(mapIdToItem);
|
|
25
|
+
const arrayWithoutDuplicates = [...mapWithoutDuplicates.values()];
|
|
26
|
+
return arrayWithoutDuplicates;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=agenda.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agenda.js","sourceRoot":"","sources":["../../src/utils/agenda.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,UAAU,iBAAiB,CAAC,YAAY,EAAE,OAAO;IACrD,IAAI,OAAO,IAAI,IAAI,EAAE;QACnB,OAAO,YAAY,CAAC;KACrB;IACD,MAAM,OAAO,GAAG,CAAC,GAAG,YAAY,EAAE,GAAG,OAAO,CAAC,CAAC;IAC9C,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC;IACzD,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAC,WAAW,CAAC,CAAC;IAClD,MAAM,sBAAsB,GAAG,CAAC,GAAG,oBAAoB,CAAC,MAAM,EAAE,CAAC,CAAC;IAElE,OAAO,sBAAsB,CAAC;AAChC,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
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 moment from 'moment';
|
|
19
|
+
export const isDate = (date) => {
|
|
20
|
+
return moment(date, moment.ISO_8601, true).isValid();
|
|
21
|
+
};
|
|
22
|
+
export const isDateTime = (date) => {
|
|
23
|
+
return isDate(date) && date?.length > 10;
|
|
24
|
+
};
|
|
25
|
+
export const getNextMonth = (date) => {
|
|
26
|
+
if (date.getMonth() === 11) {
|
|
27
|
+
return new Date(date.getFullYear() + 1, 0, 1);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
return new Date(date.getFullYear(), date.getMonth() + 1, 1);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
export const getPreviousMonth = (date) => {
|
|
34
|
+
if (date.getMonth() === 0) {
|
|
35
|
+
return new Date(date.getFullYear() - 1, 11, 1);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
return new Date(date.getFullYear(), date.getMonth() - 1, 1);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=date.js.map
|
|
@@ -0,0 +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,EAAE,CAAC,CAAC,CAAC;KAC/C;SAAM;QACL,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;KAC7D;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,IAAU,EAAQ,EAAE;IACnD,IAAI,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,EAAE;QACzB,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;KAChD;SAAM;QACL,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;KAC7D;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const displayItemName: (item: any) => string;
|
|
@@ -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 const displayItemName = (item) => item.name;
|
|
19
|
+
//# sourceMappingURL=displayers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"displayers.js","sourceRoot":"","sources":["../../src/utils/displayers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,IAAS,EAAU,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function formatDate(inputDate: any, format: any): any;
|
|
2
|
+
export declare const formatDateTime: (dateTime: any, format: any) => any;
|
|
3
|
+
export declare function formatDuration(duration: number, format: string): string;
|
|
4
|
+
export declare function formatScan(barcodeValue: any, barcodeType: any, config?: boolean): any;
|
|
5
|
+
export declare function formatURL(url: String): String;
|
|
@@ -0,0 +1,74 @@
|
|
|
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 moment from 'moment';
|
|
19
|
+
export function formatDate(inputDate, format) {
|
|
20
|
+
// Format must contains three parts : MM for the month, DD for the day and YYYY for the year
|
|
21
|
+
const date = new Date(inputDate);
|
|
22
|
+
const day = date.getDate();
|
|
23
|
+
const month = date.getMonth() + 1;
|
|
24
|
+
const year = date.getFullYear();
|
|
25
|
+
format = format.replace('MM', month.toString().padStart(2, '0'));
|
|
26
|
+
format = format.replace('YYYY', year.toString());
|
|
27
|
+
format = format.replace('DD', day.toString().padStart(2, '0'));
|
|
28
|
+
return format;
|
|
29
|
+
}
|
|
30
|
+
export const formatDateTime = (dateTime, format) => {
|
|
31
|
+
const date = new Date(dateTime);
|
|
32
|
+
const hours = date.getHours();
|
|
33
|
+
const minutes = date.getMinutes();
|
|
34
|
+
format = formatDate(dateTime, format);
|
|
35
|
+
format = format.replace('HH', hours.toString().padStart(2, '0'));
|
|
36
|
+
format = format.replace('mm', minutes.toString().padStart(2, '0'));
|
|
37
|
+
return format;
|
|
38
|
+
};
|
|
39
|
+
export function formatDuration(duration, format) {
|
|
40
|
+
const _duration = moment.duration(duration);
|
|
41
|
+
const months = _duration.months().toString().padStart(2, '0');
|
|
42
|
+
const days = _duration.days().toString().padStart(2, '0');
|
|
43
|
+
const hours = _duration.hours().toString().padStart(2, '0');
|
|
44
|
+
const minutes = _duration.minutes().toString().padStart(2, '0');
|
|
45
|
+
const seconds = _duration.seconds().toString().padStart(2, '0');
|
|
46
|
+
format = format.replace('MM', months);
|
|
47
|
+
format = format.replace('dd', days);
|
|
48
|
+
format = format.replace('HH', hours);
|
|
49
|
+
format = format.replace('mm', minutes);
|
|
50
|
+
format = format.replace('ss', seconds);
|
|
51
|
+
return format;
|
|
52
|
+
}
|
|
53
|
+
export function formatScan(barcodeValue, barcodeType, config = true) {
|
|
54
|
+
if (config && barcodeType != null && barcodeValue != null) {
|
|
55
|
+
if (barcodeType === 'EAN_13' ||
|
|
56
|
+
barcodeType === 'EAN_8' ||
|
|
57
|
+
barcodeType === 'UPC_A') {
|
|
58
|
+
return barcodeValue.slice(0, -1);
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
return barcodeValue;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
return barcodeValue;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
export function formatURL(url) {
|
|
69
|
+
if (url.slice(-1) === '/') {
|
|
70
|
+
return url;
|
|
71
|
+
}
|
|
72
|
+
return url + '/';
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=formatters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatters.js","sourceRoot":"","sources":["../../src/utils/formatters.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,MAAM,UAAU,UAAU,CAAC,SAAS,EAAE,MAAM;IAC1C,4FAA4F;IAC5F,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC;IAEjC,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;IAC3B,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IAClC,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;IAEhC,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;IACjE,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;IACjD,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;IAE/D,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE;IACjD,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC;IAChC,MAAM,K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E,MAAM,CAAC,CAAC;IACtC,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACpC,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACrC,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACvC,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAEvC,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,YAAY,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI;IACjE,IAAI,MAAM,IAAI,WAAW,IAAI,IAAI,IAAI,YAAY,IAAI,IAAI,EAAE;QACzD,IACE,WAAW,KAAK,QAAQ;YACxB,WAAW,KAAK,OAAO;YACvB,WAAW,KAAK,OAAO,EACvB;YACA,OAAO,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;SAClC;aAAM;YACL,OAAO,YAAY,CAAC;SACrB;KACF;SAAM;QACL,OAAO,YAAY,CAAC;KACrB;AACH,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,GAAW;IACnC,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;QACzB,OAAO,GAAG,CAAC;KACZ;IAED,OAAO,GAAG,GAAG,GAAG,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { updateAgendaItems } from './agenda';
|
|
2
|
+
export { isDate, isDateTime, getNextMonth, getPreviousMonth } from './date';
|
|
3
|
+
export { displayItemName } from './displayers';
|
|
4
|
+
export { formatDate, formatDateTime, formatScan, formatURL } from './formatters';
|
|
5
|
+
export { filterList, filterListContain, getFromList } from './list';
|
|
6
|
+
export { areObjectsEquals, isEmpty } from './object';
|
|
7
|
+
export { showToastMessage } from './show-toast-message';
|
|
8
|
+
export { checkNullString, stringNoAccent, splitInTwo, isHtml } from './string';
|
|
9
|
+
export { calculateDiff, formatDuration, formatTwoNumber, getIntegerPart, } from './time';
|
|
@@ -0,0 +1,27 @@
|
|
|
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 { updateAgendaItems } from './agenda';
|
|
19
|
+
export { isDate, isDateTime, getNextMonth, getPreviousMonth } from './date';
|
|
20
|
+
export { displayItemName } from './displayers';
|
|
21
|
+
export { formatDate, formatDateTime, formatScan, formatURL } from './formatters';
|
|
22
|
+
export { filterList, filterListContain, getFromList } from './list';
|
|
23
|
+
export { areObjectsEquals, isEmpty } from './object';
|
|
24
|
+
export { showToastMessage } from './show-toast-message';
|
|
25
|
+
export { checkNullString, stringNoAccent, splitInTwo, isHtml } from './string';
|
|
26
|
+
export { calculateDiff, formatDuration, formatTwoNumber, getIntegerPart, } from './time';
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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,EAAC,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,gBAAgB,EAAC,MAAM,QAAQ,CAAC;AAC1E,OAAO,EAAC,eAAe,EAAC,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAC,UAAU,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,EAAC,MAAM,cAAc,CAAC;AAC/E,OAAO,EAAC,UAAU,EAAE,iBAAiB,EAAE,WAAW,EAAC,MAAM,QAAQ,CAAC;AAClE,OAAO,EAAC,gBAAgB,EAAE,OAAO,EAAC,MAAM,UAAU,CAAC;AACnD,OAAO,EAAC,gBAAgB,EAAC,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAC,eAAe,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,EAAC,MAAM,UAAU,CAAC;AAC7E,OAAO,EACL,aAAa,EACb,cAAc,EACd,eAAe,EACf,cAAc,GACf,MAAM,QAAQ,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare function filterList(list: any, subObject: any, objectParam: any, query: any): any;
|
|
2
|
+
export declare function filterListContain(list: any, subListObject: any, objectParam: any, query: any): any;
|
|
3
|
+
export declare function getFromList(list: any, objectParam: any, query: any): any;
|
|
@@ -0,0 +1,101 @@
|
|
|
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 { areObjectsEquals } from './object';
|
|
19
|
+
export function filterList(list, subObject, objectParam, query) {
|
|
20
|
+
if (query === '' || list == null || list?.length === 0) {
|
|
21
|
+
return list;
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
const filteredList = [];
|
|
25
|
+
if (Array.isArray(subObject) &&
|
|
26
|
+
Array.isArray(objectParam) &&
|
|
27
|
+
Array.isArray(query)) {
|
|
28
|
+
if (subObject.length === objectParam.length &&
|
|
29
|
+
objectParam.length === query.length &&
|
|
30
|
+
subObject.length > 0) {
|
|
31
|
+
list.forEach(item => {
|
|
32
|
+
let criteria = true;
|
|
33
|
+
for (let i = 0; i < subObject.length; i++) {
|
|
34
|
+
criteria =
|
|
35
|
+
criteria &&
|
|
36
|
+
(query[i] === ''
|
|
37
|
+
? true
|
|
38
|
+
: item[subObject[i]] != null &&
|
|
39
|
+
areObjectsEquals(item[subObject[i]][objectParam[i]], query[i]));
|
|
40
|
+
}
|
|
41
|
+
if (criteria) {
|
|
42
|
+
filteredList.push(item);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
throw new Error('Filter criteria params length condition is not fulfilled');
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
list.forEach(item => {
|
|
52
|
+
if (item[subObject] != null &&
|
|
53
|
+
areObjectsEquals(item[subObject][objectParam], query)) {
|
|
54
|
+
filteredList.push(item);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
return filteredList;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
export function filterListContain(list, subListObject, objectParam, query) {
|
|
62
|
+
if (query === '') {
|
|
63
|
+
return list;
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
const filteredList = [];
|
|
67
|
+
list.forEach(item => {
|
|
68
|
+
if (subListContain(item[subListObject], objectParam, query)) {
|
|
69
|
+
filteredList.push(item);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
return filteredList;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function subListContain(subList, objectParam, query) {
|
|
76
|
+
if (query === '') {
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
for (let i = 0; i < subList.length; i++) {
|
|
81
|
+
if (subList[i][objectParam] === query) {
|
|
82
|
+
return true;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
export function getFromList(list, objectParam, query) {
|
|
89
|
+
if (query === '') {
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
for (let i = 0; i < list.length; i++) {
|
|
94
|
+
if (list[i][objectParam] === query) {
|
|
95
|
+
return list[i];
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/utils/list.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,gBAAgB,EAAC,MAAM,UAAU,CAAC;AAE1C,MAAM,UAAU,UAAU,CAAC,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK;IAC5D,IAAI,KAAK,KAAK,EAAE,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,EAAE,MAAM,KAAK,CAAC,EAAE;QACtD,OAAO,IAAI,CAAC;KACb;SAAM;QACL,MAAM,YAAY,GAAG,EAAE,CAAC;QACxB,IACE,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;YACxB,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC;YA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
|
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 { stringNoAccent } from './string';
|
|
19
|
+
export function areObjectsEquals(object1, object2) {
|
|
20
|
+
if (typeof object1 !== typeof object2 || object1 == null || object2 == null) {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
if (typeof object1 === 'string') {
|
|
25
|
+
return stringNoAccent(object1)
|
|
26
|
+
.toLowerCase()
|
|
27
|
+
.includes(stringNoAccent(object2).toLowerCase());
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
return object1 === object2;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
export const isEmpty = obj => Object.keys(obj).length === 0 &&
|
|
35
|
+
Object.getPrototypeOf(obj) === Object.prototype;
|
|
36
|
+
//# sourceMappingURL=object.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"object.js","sourceRoot":"","sources":["../../src/utils/object.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,cAAc,EAAC,MAAM,UAAU,CAAC;AAExC,MAAM,UAAU,gBAAgB,CAAC,OAAO,EAAE,OAAO;IAC/C,IAAI,OAAO,OAAO,KAAK,OAAO,OAAO,IAAI,OAAO,IAAI,IAAI,IAAI,OAAO,IAAI,IAAI,EAAE;QAC3E,OAAO,KAAK,CAAC;KACd;SAAM;QACL,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;YAC/B,OAAO,cAAc,CAAC,OAAO,CAAC;iBAC3B,WAAW,EAAE;iBACb,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;SACpD;aAAM;YACL,OAAO,OAAO,KAAK,OAAO,CAAC;SAC5B;KACF;AACH,CAAC;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,GAAG,CAAC,EAAE,CAC3B,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,KAAK,CAAC;IAC7B,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,KAAK,MAAM,CAAC,SAAS,CAAC"}
|
|
@@ -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 Toast from 'react-native-toast-message';
|
|
19
|
+
export const showToastMessage = (toastOptions) => {
|
|
20
|
+
return Toast.show(toastOptions);
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=show-toast-message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"show-toast-message.js","sourceRoot":"","sources":["../../src/utils/show-toast-message.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAwB,MAAM,4BAA4B,CAAC;AAElE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,YAA6B,EAAE,EAAE;IAChE,OAAO,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;AAClC,CAAC,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
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 function splitInTwo(value, spacer = '.') {
|
|
19
|
+
if (value == null) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
return value.toString().split(spacer);
|
|
23
|
+
}
|
|
24
|
+
export function isHtml(value) {
|
|
25
|
+
const regex = /<\/?[a-z][\s\S]*>/i;
|
|
26
|
+
if (value == null) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
return regex.test(value);
|
|
30
|
+
}
|
|
31
|
+
export function stringNoAccent(message) {
|
|
32
|
+
if (message == null) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
const b = 'áàâäãåçéèêëíïîìñóòôöõúùûüýÁÀÂÄÃÅÇÉÈÊËÍÏÎÌÑÓÒÔÖÕÚÙÛÜÝ';
|
|
37
|
+
const c = 'aaaaaaceeeeiiiinooooouuuuyAAAAAACEEEEIIIINOOOOOUUUUY';
|
|
38
|
+
let newMessage = message;
|
|
39
|
+
for (let i = 0; i < b.length; i++) {
|
|
40
|
+
newMessage = newMessage.replace(b.charAt(i), c.charAt(i));
|
|
41
|
+
}
|
|
42
|
+
return newMessage;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
export function checkNullString(message) {
|
|
46
|
+
if (message == null) {
|
|
47
|
+
return message;
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
let newMessage = message.replace(/\s/g, '');
|
|
51
|
+
return newMessage == null || newMessage === '';
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=string.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string.js","sourceRoot":"","sources":["../../src/utils/string.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,UAAU,UAAU,CAAC,KAAa,EAAE,MAAM,GAAG,GAAG;IACpD,IAAI,KAAK,IAAI,IAAI,EAAE;QACjB,OAAO,IAAI,CAAC;KACb;IACD,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,KAAa;IAClC,MAAM,KAAK,GAAG,oBAAoB,CAAC;IACnC,IAAI,KAAK,IAAI,IAAI,EAAE;QACjB,OAAO,IAAI,CAAC;KACb;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC3B,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,OAAO;IACpC,IAAI,OAAO,IAAI,IAAI,EAAE;QACnB,OAAO,IAAI,CAAC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