@axelor/aos-mobile-core 8.3.7 → 8.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -312
- package/lib/api/aop-filter-api.d.ts +9 -0
- package/lib/api/aop-filter-api.js +63 -0
- package/lib/api/aop-filter-api.js.map +1 -0
- package/lib/api/currency-api.d.ts +1 -0
- package/lib/api/currency-api.js +28 -0
- package/lib/api/currency-api.js.map +1 -0
- package/lib/api/index.d.ts +12 -0
- package/lib/api/index.js +30 -0
- package/lib/api/index.js.map +1 -0
- package/lib/api/login-api.js +2 -2
- package/lib/api/login-api.js.map +1 -1
- package/lib/api/metafile-api.d.ts +1 -1
- package/lib/api/print-template-api.d.ts +1 -1
- package/lib/api/print-template-api.js +2 -1
- package/lib/api/print-template-api.js.map +1 -1
- package/lib/apiProviders/Standard/requests.helper.d.ts +13 -1
- package/lib/apiProviders/Standard/requests.helper.js +37 -2
- package/lib/apiProviders/Standard/requests.helper.js.map +1 -1
- package/lib/apiProviders/middlewares/index.d.ts +2 -1
- package/lib/apiProviders/middlewares/index.js +2 -1
- package/lib/apiProviders/middlewares/index.js.map +1 -1
- package/lib/apiProviders/middlewares/maintenance.d.ts +5 -0
- package/lib/apiProviders/middlewares/maintenance.js +63 -0
- package/lib/apiProviders/middlewares/maintenance.js.map +1 -0
- package/lib/app/Application.d.ts +1 -0
- package/lib/app/Application.js +1 -1
- package/lib/app/Application.js.map +1 -1
- package/lib/app/ContextedApplication.js +4 -2
- package/lib/app/ContextedApplication.js.map +1 -1
- package/lib/app/ContextsProvider.d.ts +2 -1
- package/lib/app/ContextsProvider.js +5 -1
- package/lib/app/ContextsProvider.js.map +1 -1
- package/lib/app/modules/types.d.ts +2 -2
- package/lib/auth/api/config-api.js +1 -1
- package/lib/auth/api/config-api.js.map +1 -1
- package/lib/components/external/Camera/Camera.js +10 -0
- package/lib/components/external/Camera/Camera.js.map +1 -1
- package/lib/components/external/Toast/Toast.js +10 -35
- package/lib/components/external/Toast/Toast.js.map +1 -1
- package/lib/components/external/Toast/ToastDisplay.d.ts +4 -0
- package/lib/components/external/Toast/ToastDisplay.js +59 -0
- package/lib/components/external/Toast/ToastDisplay.js.map +1 -0
- package/lib/components/molecules/UploadFileInput/UploadFileInput.js +35 -52
- package/lib/components/molecules/UploadFileInput/UploadFileInput.js.map +1 -1
- package/lib/components/molecules/index.d.ts +0 -3
- package/lib/components/molecules/index.js +0 -3
- package/lib/components/molecules/index.js.map +1 -1
- package/lib/components/organisms/DateInput/DateInput.js +1 -4
- package/lib/components/organisms/DateInput/DateInput.js.map +1 -1
- package/lib/components/organisms/FilterContainer/FilterContainer.d.ts +12 -0
- package/lib/components/organisms/FilterContainer/FilterContainer.js +54 -0
- package/lib/components/organisms/FilterContainer/FilterContainer.js.map +1 -0
- package/lib/components/organisms/PopupFilters/PopupFilters.d.ts +10 -0
- package/lib/components/organisms/PopupFilters/PopupFilters.js +73 -0
- package/lib/components/organisms/PopupFilters/PopupFilters.js.map +1 -0
- package/lib/components/organisms/PopupPrintTemplate/PopupPrintTemplate.d.ts +3 -1
- package/lib/components/organisms/PopupPrintTemplate/PopupPrintTemplate.js +20 -34
- package/lib/components/organisms/PopupPrintTemplate/PopupPrintTemplate.js.map +1 -1
- package/lib/components/organisms/index.d.ts +2 -4
- package/lib/components/organisms/index.js +2 -4
- package/lib/components/organisms/index.js.map +1 -1
- package/lib/components/pages/FormView/FormView.js +2 -0
- package/lib/components/pages/FormView/FormView.js.map +1 -1
- package/lib/components/templates/SearchListView/SearchListView.js +8 -5
- package/lib/components/templates/SearchListView/SearchListView.js.map +1 -1
- package/lib/components/templates/index.d.ts +0 -1
- package/lib/components/templates/index.js +0 -1
- package/lib/components/templates/index.js.map +1 -1
- package/lib/features/asyncFunctions-index.d.ts +12 -0
- package/lib/features/asyncFunctions-index.js +30 -0
- package/lib/features/asyncFunctions-index.js.map +1 -0
- package/lib/features/authSlice.js +8 -0
- package/lib/features/authSlice.js.map +1 -1
- package/lib/features/cameraScannerSlice.d.ts +3 -1
- package/lib/features/cameraScannerSlice.js +14 -2
- package/lib/features/cameraScannerSlice.js.map +1 -1
- package/lib/features/{attachedFilesSlice.d.ts → currencySlice.d.ts} +3 -3
- package/lib/features/{attachedFilesSlice.js → currencySlice.js} +20 -15
- package/lib/features/currencySlice.js.map +1 -0
- package/lib/features/index.d.ts +1 -2
- package/lib/features/index.js +1 -2
- package/lib/features/index.js.map +1 -1
- package/lib/forms/studio/api.helpers.d.ts +1 -1
- package/lib/forms/studio/api.helpers.js.map +1 -1
- package/lib/header/FilterProvider.d.ts +22 -0
- package/lib/header/FilterProvider.js +48 -0
- package/lib/header/FilterProvider.js.map +1 -0
- package/lib/header/HeaderActionsProvider.d.ts +1 -0
- package/lib/header/HeaderActionsProvider.js.map +1 -1
- package/lib/header/hooks.d.ts +1 -67
- package/lib/header/hooks.js +153 -158
- package/lib/header/hooks.js.map +1 -1
- package/lib/header/index.d.ts +2 -1
- package/lib/header/index.js +1 -0
- package/lib/header/index.js.map +1 -1
- package/lib/header/types.d.ts +0 -4
- package/lib/hooks/index.d.ts +3 -0
- package/lib/hooks/index.js +3 -0
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/use-currency-formatter.d.ts +1 -0
- package/lib/hooks/use-currency-formatter.js +37 -0
- package/lib/hooks/use-currency-formatter.js.map +1 -0
- package/lib/hooks/use-header-registers.js +2 -0
- package/lib/hooks/use-header-registers.js.map +1 -1
- package/lib/hooks/use-mass-scanner.d.ts +15 -0
- package/lib/hooks/use-mass-scanner.js +70 -0
- package/lib/hooks/use-mass-scanner.js.map +1 -0
- package/lib/hooks/use-outdated-version.d.ts +3 -0
- package/lib/hooks/use-outdated-version.js +30 -0
- package/lib/hooks/use-outdated-version.js.map +1 -0
- package/lib/hooks/use-scan-activator.d.ts +8 -3
- package/lib/hooks/use-scan-activator.js +42 -22
- package/lib/hooks/use-scan-activator.js.map +1 -1
- package/lib/i18n/translations/en.json +9 -18
- package/lib/i18n/translations/fr.json +9 -18
- package/lib/index.d.ts +16 -22
- package/lib/index.js +16 -22
- package/lib/index.js.map +1 -1
- package/lib/models/objectFields.js +9 -0
- package/lib/models/objectFields.js.map +1 -1
- package/lib/navigator/Navigator.d.ts +3 -6
- package/lib/navigator/Navigator.js +17 -19
- package/lib/navigator/Navigator.js.map +1 -1
- package/lib/navigator/components/DrawerContent.d.ts +13 -0
- package/lib/navigator/{drawer → components}/DrawerContent.js +34 -73
- package/lib/navigator/components/DrawerContent.js.map +1 -0
- package/lib/navigator/components/header/Header.d.ts +9 -0
- package/lib/navigator/{drawer → components/header}/Header.js +13 -21
- package/lib/navigator/components/header/Header.js.map +1 -0
- package/lib/navigator/components/header/HeaderButton.d.ts +6 -0
- package/lib/navigator/{drawer/DrawerToggleButton.js → components/header/HeaderButton.js} +10 -10
- package/lib/navigator/components/header/HeaderButton.js.map +1 -0
- package/lib/navigator/components/header/HeaderOptionMenu.d.ts +13 -0
- package/lib/{components/organisms/HeaderOptionsMenu/HeaderOptionsMenu.js → navigator/components/header/HeaderOptionMenu.js} +10 -43
- package/lib/navigator/components/header/HeaderOptionMenu.js.map +1 -0
- package/lib/navigator/components/header/HeaderOptionMenuItem.js.map +1 -0
- package/lib/navigator/components/header/index.d.ts +1 -0
- package/lib/navigator/components/header/index.js +19 -0
- package/lib/navigator/components/header/index.js.map +1 -0
- package/lib/navigator/components/index.d.ts +2 -0
- package/lib/navigator/components/index.js +20 -0
- package/lib/navigator/components/index.js.map +1 -0
- package/lib/navigator/components/menu/AuthMenu.d.ts +8 -0
- package/lib/navigator/{drawer/AuthMenuIconButton.js → components/menu/AuthMenu.js} +10 -9
- package/lib/navigator/components/menu/AuthMenu.js.map +1 -0
- package/lib/navigator/components/menu/Menu.d.ts +13 -0
- package/lib/navigator/components/menu/Menu.js +63 -0
- package/lib/navigator/components/menu/Menu.js.map +1 -0
- package/lib/navigator/components/menu/MenuIconButton.d.ts +14 -0
- package/lib/navigator/{drawer → components/menu}/MenuIconButton.js +17 -20
- package/lib/navigator/components/menu/MenuIconButton.js.map +1 -0
- package/lib/navigator/components/menu/MenuItem.d.ts +14 -0
- package/lib/navigator/{drawer → components/menu}/MenuItem.js +6 -6
- package/lib/navigator/components/menu/MenuItem.js.map +1 -0
- package/lib/navigator/components/menu/MenuItemEntry.d.ts +16 -0
- package/lib/navigator/{drawer → components/menu}/MenuItemEntry.js +11 -19
- package/lib/navigator/components/menu/MenuItemEntry.js.map +1 -0
- package/lib/navigator/components/menu/MenuItemList.d.ts +12 -0
- package/lib/navigator/{drawer/Menu.js → components/menu/MenuItemList.js} +5 -46
- package/lib/navigator/components/menu/MenuItemList.js.map +1 -0
- package/lib/navigator/components/menu/MenuSeparator.d.ts +7 -0
- package/lib/navigator/{drawer → components/menu}/MenuSeparator.js +4 -8
- package/lib/navigator/components/menu/MenuSeparator.js.map +1 -0
- package/lib/navigator/components/menu/MenuTitle.d.ts +8 -0
- package/lib/navigator/{drawer → components/menu}/MenuTitle.js +3 -3
- package/lib/navigator/components/menu/MenuTitle.js.map +1 -0
- package/lib/navigator/components/menu/SubMenuItem.d.ts +9 -0
- package/lib/navigator/{drawer → components/menu}/SubMenuItem.js +4 -4
- package/lib/navigator/components/menu/SubMenuItem.js.map +1 -0
- package/lib/navigator/components/menu/SubMenuItemList.d.ts +12 -0
- package/lib/navigator/{drawer → components/menu}/SubMenuItemList.js +5 -5
- package/lib/navigator/components/menu/SubMenuItemList.js.map +1 -0
- package/lib/navigator/components/menu/index.d.ts +4 -0
- package/lib/navigator/components/menu/index.js +22 -0
- package/lib/navigator/components/menu/index.js.map +1 -0
- package/lib/navigator/helpers/access.helper.d.ts +4 -0
- package/lib/navigator/helpers/access.helper.js +121 -0
- package/lib/navigator/helpers/access.helper.js.map +1 -0
- package/lib/navigator/helpers/compatibility.helper.d.ts +3 -0
- package/lib/navigator/helpers/compatibility.helper.js +123 -0
- package/lib/navigator/helpers/compatibility.helper.js.map +1 -0
- package/lib/navigator/helpers/index.d.ts +6 -0
- package/lib/navigator/helpers/index.js +24 -0
- package/lib/navigator/helpers/index.js.map +1 -0
- package/lib/navigator/helpers/menu.helper.d.ts +56 -0
- package/lib/navigator/{menu.helper.js → helpers/menu.helper.js} +17 -22
- package/lib/navigator/helpers/menu.helper.js.map +1 -0
- package/lib/navigator/helpers/module.helper.d.ts +8 -0
- package/lib/navigator/helpers/module.helper.js +58 -0
- package/lib/navigator/helpers/module.helper.js.map +1 -0
- package/lib/navigator/helpers/navigation-type.d.ts +4 -0
- package/lib/navigator/helpers/navigation-type.js +19 -0
- package/lib/navigator/helpers/navigation-type.js.map +1 -0
- package/lib/navigator/helpers/tool.helper.d.ts +3 -0
- package/lib/navigator/helpers/tool.helper.js +44 -0
- package/lib/navigator/helpers/tool.helper.js.map +1 -0
- package/lib/navigator/index.d.ts +3 -1
- package/lib/navigator/index.js +3 -1
- package/lib/navigator/index.js.map +1 -1
- package/lib/navigator/{ActiveScreenProvider.d.ts → providers/active-screen.d.ts} +1 -1
- package/lib/navigator/{ActiveScreenProvider.js → providers/active-screen.js} +3 -3
- package/lib/navigator/providers/active-screen.js.map +1 -0
- package/lib/navigator/providers/index.d.ts +3 -0
- package/lib/navigator/providers/index.js +21 -0
- package/lib/navigator/providers/index.js.map +1 -0
- package/lib/navigator/providers/module-navigator.d.ts +8 -0
- package/lib/{screens/MailMessageScreen.js → navigator/providers/module-navigator.js} +7 -7
- package/lib/navigator/providers/module-navigator.js.map +1 -0
- package/lib/navigator/{NavigationInformationsProvider.d.ts → providers/navigation-informations.d.ts} +6 -2
- package/lib/navigator/{NavigationInformationsProvider.js → providers/navigation-informations.js} +11 -10
- package/lib/navigator/providers/navigation-informations.js.map +1 -0
- package/lib/screens/ErrorScreen.d.ts +7 -5
- package/lib/screens/ErrorScreen.js +26 -4
- package/lib/screens/ErrorScreen.js.map +1 -1
- package/lib/screens/index.d.ts +10 -33
- package/lib/screens/index.js +1 -17
- package/lib/screens/index.js.map +1 -1
- package/lib/tools/FileDownloader.js +7 -2
- package/lib/tools/FileDownloader.js.map +1 -1
- package/lib/tools/FilePicker.js +4 -3
- package/lib/tools/FilePicker.js.map +1 -1
- package/lib/types/index.d.ts +0 -2
- package/lib/types/index.js +0 -2
- package/lib/types/index.js.map +1 -1
- package/lib/utils/date.d.ts +1 -0
- package/lib/utils/date.js +4 -1
- package/lib/utils/date.js.map +1 -1
- package/lib/utils/index.d.ts +2 -2
- package/lib/utils/index.js +2 -2
- package/lib/utils/index.js.map +1 -1
- package/lib/websocket/WebSocketProvider.d.ts +20 -0
- package/lib/websocket/WebSocketProvider.js +89 -0
- package/lib/websocket/WebSocketProvider.js.map +1 -0
- package/lib/websocket/hooks.d.ts +2 -0
- package/lib/{navigator/drawer/BackIcon.js → websocket/hooks.js} +8 -17
- package/lib/websocket/hooks.js.map +1 -0
- package/lib/websocket/index.d.ts +2 -0
- package/lib/websocket/index.js +20 -0
- package/lib/websocket/index.js.map +1 -0
- package/lib/websocket/types.d.ts +13 -0
- package/lib/websocket/types.js +26 -0
- package/lib/websocket/types.js.map +1 -0
- package/package.json +35 -29
- package/lib/api/mail-message-api.d.ts +0 -44
- package/lib/api/mail-message-api.js +0 -129
- package/lib/api/mail-message-api.js.map +0 -1
- package/lib/components/molecules/HeaderOptionsMenuItem/HeaderOptionMenuItem.js.map +0 -1
- package/lib/components/molecules/MailMessageReadIcon/MailMessageReadIcon.d.ts +0 -12
- package/lib/components/molecules/MailMessageReadIcon/MailMessageReadIcon.js +0 -59
- package/lib/components/molecules/MailMessageReadIcon/MailMessageReadIcon.js.map +0 -1
- package/lib/components/molecules/TrackItem/TrackItem.d.ts +0 -10
- package/lib/components/molecules/TrackItem/TrackItem.js +0 -65
- package/lib/components/molecules/TrackItem/TrackItem.js.map +0 -1
- package/lib/components/organisms/HeaderOptionsMenu/HeaderOptionsMenu.d.ts +0 -13
- package/lib/components/organisms/HeaderOptionsMenu/HeaderOptionsMenu.js.map +0 -1
- package/lib/components/organisms/MailMessageCard/MailMessageCard.d.ts +0 -17
- package/lib/components/organisms/MailMessageCard/MailMessageCard.js +0 -76
- package/lib/components/organisms/MailMessageCard/MailMessageCard.js.map +0 -1
- package/lib/components/organisms/MailMessageCommentCard/MailMessageCommentCard.d.ts +0 -13
- package/lib/components/organisms/MailMessageCommentCard/MailMessageCommentCard.js +0 -138
- package/lib/components/organisms/MailMessageCommentCard/MailMessageCommentCard.js.map +0 -1
- package/lib/components/organisms/MailMessageNotificationCard/MailMessageNotificationCard.d.ts +0 -17
- package/lib/components/organisms/MailMessageNotificationCard/MailMessageNotificationCard.js +0 -81
- package/lib/components/organisms/MailMessageNotificationCard/MailMessageNotificationCard.js.map +0 -1
- package/lib/components/templates/MailMessageView/MailMessageView.d.ts +0 -10
- package/lib/components/templates/MailMessageView/MailMessageView.js +0 -184
- package/lib/components/templates/MailMessageView/MailMessageView.js.map +0 -1
- package/lib/features/attachedFilesSlice.js.map +0 -1
- package/lib/features/mailMessageSlice.d.ts +0 -97
- package/lib/features/mailMessageSlice.js +0 -196
- package/lib/features/mailMessageSlice.js.map +0 -1
- package/lib/navigator/ActiveScreenProvider.js.map +0 -1
- package/lib/navigator/NavigationInformationsProvider.js.map +0 -1
- package/lib/navigator/drawer/AuthMenuIconButton.d.ts +0 -7
- package/lib/navigator/drawer/AuthMenuIconButton.js.map +0 -1
- package/lib/navigator/drawer/BackIcon.d.ts +0 -5
- package/lib/navigator/drawer/BackIcon.js.map +0 -1
- package/lib/navigator/drawer/DrawerContent.d.ts +0 -10
- package/lib/navigator/drawer/DrawerContent.js.map +0 -1
- package/lib/navigator/drawer/DrawerToggleButton.d.ts +0 -5
- package/lib/navigator/drawer/DrawerToggleButton.js.map +0 -1
- package/lib/navigator/drawer/Header.d.ts +0 -8
- package/lib/navigator/drawer/Header.js.map +0 -1
- package/lib/navigator/drawer/Menu.d.ts +0 -10
- package/lib/navigator/drawer/Menu.js.map +0 -1
- package/lib/navigator/drawer/MenuIconButton.d.ts +0 -12
- package/lib/navigator/drawer/MenuIconButton.js.map +0 -1
- package/lib/navigator/drawer/MenuItem.d.ts +0 -12
- package/lib/navigator/drawer/MenuItem.js.map +0 -1
- package/lib/navigator/drawer/MenuItemEntry.d.ts +0 -14
- package/lib/navigator/drawer/MenuItemEntry.js.map +0 -1
- package/lib/navigator/drawer/MenuSeparator.d.ts +0 -6
- package/lib/navigator/drawer/MenuSeparator.js.map +0 -1
- package/lib/navigator/drawer/MenuTitle.d.ts +0 -6
- package/lib/navigator/drawer/MenuTitle.js.map +0 -1
- package/lib/navigator/drawer/SubMenuItem.d.ts +0 -8
- package/lib/navigator/drawer/SubMenuItem.js.map +0 -1
- package/lib/navigator/drawer/SubMenuItemList.d.ts +0 -11
- package/lib/navigator/drawer/SubMenuItemList.js.map +0 -1
- package/lib/navigator/menu.helper.d.ts +0 -17
- package/lib/navigator/menu.helper.js.map +0 -1
- package/lib/navigator/module.helper.d.ts +0 -25
- package/lib/navigator/module.helper.js +0 -299
- package/lib/navigator/module.helper.js.map +0 -1
- package/lib/screens/MailMessageAttachedFilesScreen.d.ts +0 -5
- package/lib/screens/MailMessageAttachedFilesScreen.js +0 -68
- package/lib/screens/MailMessageAttachedFilesScreen.js.map +0 -1
- package/lib/screens/MailMessageScreen.d.ts +0 -5
- package/lib/screens/MailMessageScreen.js.map +0 -1
- package/lib/types/mail-message-notification-type.d.ts +0 -12
- package/lib/types/mail-message-notification-type.js +0 -48
- package/lib/types/mail-message-notification-type.js.map +0 -1
- package/lib/types/mail-message-type.d.ts +0 -18
- package/lib/types/mail-message-type.js +0 -55
- package/lib/types/mail-message-type.js.map +0 -1
- /package/lib/{components/molecules/HeaderOptionsMenuItem → navigator/components/header}/HeaderOptionMenuItem.d.ts +0 -0
- /package/lib/{components/molecules/HeaderOptionsMenuItem → navigator/components/header}/HeaderOptionMenuItem.js +0 -0
package/lib/header/hooks.d.ts
CHANGED
|
@@ -1,67 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
model: any;
|
|
3
|
-
modelId: any;
|
|
4
|
-
disableMailMessages: any;
|
|
5
|
-
disablePrint: any;
|
|
6
|
-
disableJsonFields?: boolean;
|
|
7
|
-
barcodeFieldname?: string;
|
|
8
|
-
}): {
|
|
9
|
-
mailMessagesAction: {
|
|
10
|
-
key: string;
|
|
11
|
-
order: number;
|
|
12
|
-
onPress: () => void;
|
|
13
|
-
hideIf: any;
|
|
14
|
-
indicator: any;
|
|
15
|
-
iconName: string;
|
|
16
|
-
title: string;
|
|
17
|
-
showInHeader: boolean;
|
|
18
|
-
};
|
|
19
|
-
printAction: {
|
|
20
|
-
key: string;
|
|
21
|
-
order: number;
|
|
22
|
-
onPress: () => void;
|
|
23
|
-
iconName: string;
|
|
24
|
-
hideIf: any;
|
|
25
|
-
title: string;
|
|
26
|
-
showInHeader: boolean;
|
|
27
|
-
};
|
|
28
|
-
barcodeAction: {
|
|
29
|
-
key: string;
|
|
30
|
-
order: number;
|
|
31
|
-
title: string;
|
|
32
|
-
iconName: string;
|
|
33
|
-
hideIf: boolean;
|
|
34
|
-
onPress: () => void;
|
|
35
|
-
showInHeader: boolean;
|
|
36
|
-
};
|
|
37
|
-
jsonFieldsAction: {
|
|
38
|
-
key: string;
|
|
39
|
-
order: number;
|
|
40
|
-
title: string;
|
|
41
|
-
iconName: string;
|
|
42
|
-
hideIf: boolean;
|
|
43
|
-
onPress: () => void;
|
|
44
|
-
showInHeader: boolean;
|
|
45
|
-
};
|
|
46
|
-
isTemplateSelectorVisible: boolean;
|
|
47
|
-
closePrintTemplateSelector: () => void;
|
|
48
|
-
} | {
|
|
49
|
-
mailMessagesAction: {
|
|
50
|
-
key: string;
|
|
51
|
-
hideIf: boolean;
|
|
52
|
-
};
|
|
53
|
-
printAction: {
|
|
54
|
-
key: string;
|
|
55
|
-
hideIf: boolean;
|
|
56
|
-
};
|
|
57
|
-
barcodeAction: {
|
|
58
|
-
key: string;
|
|
59
|
-
hideIf: boolean;
|
|
60
|
-
};
|
|
61
|
-
jsonFieldsAction: {
|
|
62
|
-
key: string;
|
|
63
|
-
hideIf: boolean;
|
|
64
|
-
};
|
|
65
|
-
isTemplateSelectorVisible: boolean;
|
|
66
|
-
closePrintTemplateSelector: () => void;
|
|
67
|
-
};
|
|
1
|
+
export declare const useBasicActions: () => void;
|
package/lib/header/hooks.js
CHANGED
|
@@ -15,176 +15,171 @@
|
|
|
15
15
|
* You should have received a copy of the GNU Affero General Public License
|
|
16
16
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import { useDispatch, useSelector } from 'react-redux';
|
|
21
|
-
import { countUnreadMailMessages } from '../features/mailMessageSlice';
|
|
18
|
+
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
19
|
+
import { useSelector } from '../redux/hooks';
|
|
22
20
|
import { useTranslator } from '../i18n';
|
|
23
|
-
import { checkNullString } from '../utils';
|
|
24
|
-
import { fetchModel } from '../api/model-api';
|
|
25
21
|
import { useOnline } from '../features/onlineSlice';
|
|
26
|
-
import {
|
|
22
|
+
import { useNavigation } from '../hooks/use-navigation';
|
|
27
23
|
import { fetchJsonFieldsOfModel } from '../forms';
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const I18n = useTranslator();
|
|
33
|
-
const online = useOnline();
|
|
24
|
+
import { fetchModel, getNetInfo, fetchActionPrint, fetchDefaultFilters, fetchMetaFilters, } from '../api';
|
|
25
|
+
import { PopupFilters, PopupPrintTemplate } from '../components';
|
|
26
|
+
import { headerActionsProvider } from './HeaderActionsProvider';
|
|
27
|
+
export const useBasicActions = () => {
|
|
34
28
|
const connectionInterval = useRef();
|
|
35
|
-
const isFocused = useIsFocused();
|
|
36
|
-
const dispatch = useDispatch();
|
|
37
|
-
const { unreadMessages } = useSelector(state => state.mailMessages);
|
|
38
|
-
const [disableBarcode, setDisableBarcode] = useState(true);
|
|
39
|
-
const [disableCustomView, setDisableCustomView] = useState(true);
|
|
40
|
-
const [disablePrinting, setDisablePrinting] = useState(true);
|
|
41
29
|
const [isConnected, setIsConnected] = useState(true);
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
setTemplateSelectorVisible(false);
|
|
30
|
+
const checkInternetConnection = useCallback(async () => {
|
|
31
|
+
const { isConnected: _isConnected } = await getNetInfo();
|
|
32
|
+
setIsConnected(_isConnected);
|
|
46
33
|
}, []);
|
|
47
|
-
const countUnreadMessagesAPI = useCallback(() => {
|
|
48
|
-
if (modelConfigured) {
|
|
49
|
-
dispatch(countUnreadMailMessages({ model, modelId }));
|
|
50
|
-
}
|
|
51
|
-
}, [dispatch, model, modelConfigured, modelId]);
|
|
52
34
|
useEffect(() => {
|
|
53
|
-
|
|
54
|
-
|
|
35
|
+
connectionInterval.current = setInterval(checkInternetConnection, 5000);
|
|
36
|
+
return () => clearInterval(connectionInterval.current);
|
|
37
|
+
}, [checkInternetConnection]);
|
|
38
|
+
useFilterGenericAction();
|
|
39
|
+
useBarcodeGenericAction();
|
|
40
|
+
useJsonFieldsGenericAction(isConnected);
|
|
41
|
+
usePrintingGenericAction(isConnected);
|
|
42
|
+
};
|
|
43
|
+
const useFilterGenericAction = () => {
|
|
44
|
+
const I18n = useTranslator();
|
|
45
|
+
const { userId } = useSelector(state => state.auth);
|
|
46
|
+
const [alertVisible, setAlertVisible] = useState(false);
|
|
55
47
|
useEffect(() => {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
48
|
+
headerActionsProvider.registerGenericAction('core_modelFilters', async ({ model, modelId, options }) => {
|
|
49
|
+
const _defaultAction = {
|
|
50
|
+
key: 'savedFilters',
|
|
51
|
+
order: 50,
|
|
52
|
+
iconName: 'filter',
|
|
53
|
+
title: I18n.t('Base_ShowSavedFilter'),
|
|
54
|
+
showInHeader: true,
|
|
55
|
+
hideIf: true,
|
|
56
|
+
onPress: () => { },
|
|
57
|
+
};
|
|
58
|
+
if (modelId != null || model == null)
|
|
59
|
+
return _defaultAction;
|
|
60
|
+
const { savedFilters, userFilters } = await fetchDefaultFilters({
|
|
61
|
+
modelName: model,
|
|
62
|
+
options,
|
|
63
|
+
})
|
|
64
|
+
.then(res => res?.data?.data)
|
|
65
|
+
.then(async (res) => {
|
|
66
|
+
const _filters = (res?.view?.filters ?? []).map((_f) => ({
|
|
67
|
+
..._f,
|
|
68
|
+
id: _f.name,
|
|
69
|
+
}));
|
|
70
|
+
const filterName = options?.name ?? res?.view?.name;
|
|
71
|
+
let _userFilters = [];
|
|
72
|
+
if (filterName) {
|
|
73
|
+
_userFilters = await fetchMetaFilters({ filterName, userId })
|
|
74
|
+
.then(metaRes => metaRes?.data?.data ?? [])
|
|
75
|
+
.catch(() => []);
|
|
76
|
+
}
|
|
77
|
+
return { savedFilters: _filters, userFilters: _userFilters };
|
|
78
|
+
})
|
|
79
|
+
.catch(() => ({ savedFilters: [], userFilters: [] }));
|
|
80
|
+
return {
|
|
81
|
+
..._defaultAction,
|
|
82
|
+
hideIf: savedFilters?.length === 0 && userFilters?.length === 0,
|
|
83
|
+
onPress: () => setAlertVisible(true),
|
|
84
|
+
customComponent: (<PopupFilters visible={alertVisible} onClose={() => setAlertVisible(false)} savedFilters={savedFilters} userFilters={userFilters} model={model}/>),
|
|
85
|
+
};
|
|
86
|
+
});
|
|
87
|
+
}, [I18n, alertVisible, userId]);
|
|
88
|
+
};
|
|
89
|
+
const useJsonFieldsGenericAction = (isConnected) => {
|
|
90
|
+
const I18n = useTranslator();
|
|
91
|
+
const navigation = useNavigation();
|
|
92
|
+
const online = useOnline();
|
|
62
93
|
useEffect(() => {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
94
|
+
headerActionsProvider.registerGenericAction('core_modelJsonFields', async ({ model, modelId, options }) => {
|
|
95
|
+
const _defaultAction = {
|
|
96
|
+
key: 'metaJsonFields',
|
|
97
|
+
order: 30,
|
|
98
|
+
title: I18n.t('Base_MetaJsonFields'),
|
|
99
|
+
iconName: 'layout-text-window-reverse',
|
|
100
|
+
showInHeader: true,
|
|
101
|
+
hideIf: true,
|
|
102
|
+
onPress: () => { },
|
|
103
|
+
};
|
|
104
|
+
if (modelId == null || model == null)
|
|
105
|
+
return _defaultAction;
|
|
106
|
+
const canDisplay = await fetchJsonFieldsOfModel({ modelName: model })
|
|
107
|
+
.catch(() => false)
|
|
108
|
+
.then(res => res?.data?.total > 0);
|
|
109
|
+
return {
|
|
110
|
+
..._defaultAction,
|
|
111
|
+
hideIf: !canDisplay ||
|
|
112
|
+
options?.disableJsonFields ||
|
|
113
|
+
!online.isEnabled ||
|
|
114
|
+
!isConnected,
|
|
115
|
+
onPress: () => navigation.navigate('JsonFieldScreen', { model, modelId }),
|
|
116
|
+
};
|
|
67
117
|
});
|
|
68
|
-
}, [
|
|
118
|
+
}, [I18n, isConnected, navigation, online.isEnabled]);
|
|
119
|
+
};
|
|
120
|
+
const useBarcodeGenericAction = () => {
|
|
121
|
+
const I18n = useTranslator();
|
|
122
|
+
const navigation = useNavigation();
|
|
69
123
|
useEffect(() => {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
124
|
+
headerActionsProvider.registerGenericAction('core_modelBarcode', async ({ model, modelId, options }) => {
|
|
125
|
+
const _defaultAction = {
|
|
126
|
+
key: 'barcode',
|
|
127
|
+
order: 30,
|
|
128
|
+
title: I18n.t('Base_Barcode'),
|
|
129
|
+
iconName: 'qr-code',
|
|
130
|
+
showInHeader: true,
|
|
131
|
+
hideIf: true,
|
|
132
|
+
onPress: () => { },
|
|
133
|
+
};
|
|
134
|
+
if (modelId == null || model == null)
|
|
135
|
+
return _defaultAction;
|
|
136
|
+
const barcodeFieldname = options?.barcodeFieldname ?? 'barCode';
|
|
137
|
+
const hideAction = await fetchModel({ model, modelId })
|
|
138
|
+
.then(object => object?.[barcodeFieldname] == null)
|
|
139
|
+
.catch(() => true);
|
|
140
|
+
return {
|
|
141
|
+
..._defaultAction,
|
|
142
|
+
hideIf: hideAction,
|
|
143
|
+
onPress: () => navigation.navigate('BarcodeDisplayScreen', {
|
|
144
|
+
model,
|
|
145
|
+
modelId,
|
|
146
|
+
barcodeFieldname,
|
|
147
|
+
}),
|
|
148
|
+
};
|
|
149
|
+
});
|
|
150
|
+
}, [I18n, navigation]);
|
|
151
|
+
};
|
|
152
|
+
const usePrintingGenericAction = (isConnected) => {
|
|
153
|
+
const I18n = useTranslator();
|
|
154
|
+
const online = useOnline();
|
|
155
|
+
const [alertVisible, setAlertVisible] = useState(false);
|
|
82
156
|
useEffect(() => {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
order: 20,
|
|
97
|
-
onPress: () => navigation.navigate('MailMessageScreen', {
|
|
98
|
-
model,
|
|
99
|
-
modelId,
|
|
100
|
-
}),
|
|
101
|
-
hideIf: disableMailMessages,
|
|
102
|
-
indicator: unreadMessages,
|
|
103
|
-
iconName: 'bell-fill',
|
|
104
|
-
title: I18n.t('Base_MailMessages'),
|
|
105
|
-
showInHeader: true,
|
|
106
|
-
};
|
|
107
|
-
}, [I18n, disableMailMessages, model, modelId, navigation, unreadMessages]);
|
|
108
|
-
const barcodeAction = useMemo(() => {
|
|
109
|
-
return {
|
|
110
|
-
key: 'barcode',
|
|
111
|
-
order: 30,
|
|
112
|
-
title: I18n.t('Base_Barcode'),
|
|
113
|
-
iconName: 'qr-code',
|
|
114
|
-
hideIf: disableBarcode,
|
|
115
|
-
onPress: () => navigation.navigate('BarcodeDisplayScreen', {
|
|
116
|
-
model,
|
|
117
|
-
modelId,
|
|
118
|
-
barcodeFieldname,
|
|
119
|
-
}),
|
|
120
|
-
showInHeader: true,
|
|
121
|
-
};
|
|
122
|
-
}, [I18n, barcodeFieldname, disableBarcode, model, modelId, navigation]);
|
|
123
|
-
const jsonFieldsAction = useMemo(() => {
|
|
124
|
-
return {
|
|
125
|
-
key: 'metaJsonFields',
|
|
126
|
-
order: 30,
|
|
127
|
-
title: I18n.t('Base_MetaJsonFields'),
|
|
128
|
-
iconName: 'layout-text-window-reverse',
|
|
129
|
-
hideIf: disableCustomView ||
|
|
130
|
-
disableJsonFields ||
|
|
131
|
-
!online.isEnabled ||
|
|
132
|
-
!isConnected,
|
|
133
|
-
onPress: () => navigation.navigate('JsonFieldScreen', {
|
|
157
|
+
headerActionsProvider.registerGenericAction('core_modelPrinting', async ({ model, modelId, options }) => {
|
|
158
|
+
const _defaultAction = {
|
|
159
|
+
key: 'printTemplate',
|
|
160
|
+
order: 40,
|
|
161
|
+
iconName: 'printer-fill',
|
|
162
|
+
title: I18n.t('Base_Print'),
|
|
163
|
+
showInHeader: true,
|
|
164
|
+
hideIf: true,
|
|
165
|
+
onPress: () => { },
|
|
166
|
+
};
|
|
167
|
+
if (modelId == null || model == null)
|
|
168
|
+
return _defaultAction;
|
|
169
|
+
const { templateSet, fileName } = await fetchActionPrint({
|
|
134
170
|
model,
|
|
135
|
-
modelId,
|
|
136
|
-
})
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
]);
|
|
149
|
-
const printAction = useMemo(() => {
|
|
150
|
-
return {
|
|
151
|
-
key: 'printTemplate',
|
|
152
|
-
order: 40,
|
|
153
|
-
onPress: () => {
|
|
154
|
-
setTemplateSelectorVisible(true);
|
|
155
|
-
},
|
|
156
|
-
iconName: 'printer-fill',
|
|
157
|
-
hideIf: disablePrint || disablePrinting || !online.isEnabled || !isConnected,
|
|
158
|
-
title: I18n.t('Base_Print'),
|
|
159
|
-
showInHeader: true,
|
|
160
|
-
};
|
|
161
|
-
}, [I18n, disablePrint, disablePrinting, isConnected, online.isEnabled]);
|
|
162
|
-
return useMemo(() => {
|
|
163
|
-
return {
|
|
164
|
-
isTemplateSelectorVisible,
|
|
165
|
-
closePrintTemplateSelector,
|
|
166
|
-
...(modelConfigured
|
|
167
|
-
? {
|
|
168
|
-
mailMessagesAction,
|
|
169
|
-
printAction,
|
|
170
|
-
barcodeAction,
|
|
171
|
-
jsonFieldsAction,
|
|
172
|
-
}
|
|
173
|
-
: {
|
|
174
|
-
mailMessagesAction: { key: 'mailMessages', hideIf: true },
|
|
175
|
-
printAction: { key: 'printTemplate', hideIf: true },
|
|
176
|
-
barcodeAction: { key: 'barcode', hideIf: true },
|
|
177
|
-
jsonFieldsAction: { key: 'metaJsonFields', hideIf: true },
|
|
178
|
-
}),
|
|
179
|
-
};
|
|
180
|
-
}, [
|
|
181
|
-
modelConfigured,
|
|
182
|
-
mailMessagesAction,
|
|
183
|
-
printAction,
|
|
184
|
-
barcodeAction,
|
|
185
|
-
jsonFieldsAction,
|
|
186
|
-
isTemplateSelectorVisible,
|
|
187
|
-
closePrintTemplateSelector,
|
|
188
|
-
]);
|
|
171
|
+
id: modelId,
|
|
172
|
+
});
|
|
173
|
+
return {
|
|
174
|
+
..._defaultAction,
|
|
175
|
+
hideIf: options?.disablePrint ||
|
|
176
|
+
(templateSet == null && fileName == null) ||
|
|
177
|
+
!online.isEnabled ||
|
|
178
|
+
!isConnected,
|
|
179
|
+
onPress: () => setAlertVisible(true),
|
|
180
|
+
customComponent: (<PopupPrintTemplate visible={alertVisible} onClose={() => setAlertVisible(false)} model={model} modelId={modelId} templateSet={templateSet} fileName={fileName}/>),
|
|
181
|
+
};
|
|
182
|
+
});
|
|
183
|
+
}, [I18n, alertVisible, isConnected, online.isEnabled]);
|
|
189
184
|
};
|
|
190
185
|
//# sourceMappingURL=hooks.js.map
|
package/lib/header/hooks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../src/header/hooks.
|
|
1
|
+
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../src/header/hooks.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AACtE,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAC,aAAa,EAAC,MAAM,SAAS,CAAC;AACtC,OAAO,EAAC,SAAS,EAAC,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAC,aAAa,EAAC,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAC,sBAAsB,EAAC,MAAM,UAAU,CAAC;AAChD,OAAO,EACL,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAC,YAAY,EAAE,kBAAkB,EAAC,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAC,qBAAqB,EAAC,MAAM,yBAAyB,CAAC;AAE9D,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,EAAE;IAClC,MAAM,kBAAkB,GAAG,MAAM,EAAU,CAAC;IAE5C,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAErD,MAAM,uBAAuB,GAAG,WAAW,CAAC,KAAK,IAAI,EAAE;QACrD,MAAM,EAAC,WAAW,EAAE,YAAY,EAAC,GAAG,MAAM,UAAU,EAAE,CAAC;QACvD,cAAc,CAAC,YAAY,CAAC,CAAC;IAC/B,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,SAAS,CAAC,GAAG,EAAE;QACb,kBAAkB,CAAC,OAAO,GAAG,WAAW,CAAC,uBAAuB,EAAE,IAAI,CA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B,CAAC,WAAW;gBACd,OAAO,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC;gBACpC,eAAe,EAAE,CACf,CAAC,kBAAkB,CACjB,OAAO,CAAC,CAAC,YAAY,CAAC,CACtB,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CACtC,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,QAAQ,CAAC,CAAC,QAAQ,CAAC,EACnB,CACH;aACF,CAAC;QACJ,CAAC,CACF,CAAC;IACJ,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;AAC1D,CAAC,CAAC"}
|
package/lib/header/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
export { filterProvider, useActiveFilter } from './FilterProvider';
|
|
1
2
|
export { headerActionsProvider, useHeaderActions } from './HeaderActionsProvider';
|
|
2
3
|
export { useBasicActions } from './hooks';
|
|
3
|
-
export {
|
|
4
|
+
export { ActionType, GenericHeaderActions, HeaderActions, HeaderBandItem, HeaderOptions, } from './types';
|
|
4
5
|
export { HeaderBandProvider, useHeaderBand } from './HeaderBandContext';
|
|
5
6
|
export { HeaderBandHelper } from './header-band-context.helper';
|
|
6
7
|
export { fetchOptionsOfHeaderKey } from './utils';
|
package/lib/header/index.js
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
* You should have received a copy of the GNU Affero General Public License
|
|
16
16
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
|
+
export { filterProvider, useActiveFilter } from './FilterProvider';
|
|
18
19
|
export { headerActionsProvider, useHeaderActions } from './HeaderActionsProvider';
|
|
19
20
|
export { useBasicActions } from './hooks';
|
|
20
21
|
export { HeaderBandProvider, useHeaderBand } from './HeaderBandContext';
|
package/lib/header/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/header/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,qBAAqB,EAAE,gBAAgB,EAAC,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAC,eAAe,EAAC,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/header/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,cAAc,EAAE,eAAe,EAAC,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAC,qBAAqB,EAAE,gBAAgB,EAAC,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAC,eAAe,EAAC,MAAM,SAAS,CAAC;AAQxC,OAAO,EAAC,kBAAkB,EAAE,aAAa,EAAC,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAC,uBAAuB,EAAC,MAAM,SAAS,CAAC"}
|
package/lib/header/types.d.ts
CHANGED
|
@@ -7,10 +7,6 @@ export interface HeaderOptions {
|
|
|
7
7
|
model?: string;
|
|
8
8
|
modelId?: number;
|
|
9
9
|
options?: any;
|
|
10
|
-
disablePrint?: boolean;
|
|
11
|
-
disableMailMessages?: boolean;
|
|
12
|
-
disableJsonFields?: boolean;
|
|
13
|
-
barcodeFieldname?: string;
|
|
14
10
|
headerTitle?: string;
|
|
15
11
|
actions?: ActionType[];
|
|
16
12
|
}
|
package/lib/hooks/index.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export * from './use-effect-debugger';
|
|
2
|
+
export { useCurrencyFormat } from './use-currency-formatter';
|
|
3
|
+
export { useMassScanner } from './use-mass-scanner';
|
|
2
4
|
export { useIsFocused, useNavigation, useNavigationRoutes, useStackChecker, } from './use-navigation';
|
|
5
|
+
export { useOutdatedVersion } from './use-outdated-version';
|
|
3
6
|
export { useScanActivator, useScannerDeviceActivator, useCameraScannerActivator, } from './use-scan-activator';
|
|
4
7
|
export { useConfigUpdater, useStorageUpdater } from './use-storage-config';
|
package/lib/hooks/index.js
CHANGED
|
@@ -16,7 +16,10 @@
|
|
|
16
16
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
18
|
export * from './use-effect-debugger';
|
|
19
|
+
export { useCurrencyFormat } from './use-currency-formatter';
|
|
20
|
+
export { useMassScanner } from './use-mass-scanner';
|
|
19
21
|
export { useIsFocused, useNavigation, useNavigationRoutes, useStackChecker, } from './use-navigation';
|
|
22
|
+
export { useOutdatedVersion } from './use-outdated-version';
|
|
20
23
|
export { useScanActivator, useScannerDeviceActivator, useCameraScannerActivator, } from './use-scan-activator';
|
|
21
24
|
export { useConfigUpdater, useStorageUpdater } from './use-storage-config';
|
|
22
25
|
//# sourceMappingURL=index.js.map
|
package/lib/hooks/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,cAAc,uBAAuB,CAAC;AACtC,OAAO,EACL,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,gBAAgB,EAChB,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAC,gBAAgB,EAAE,iBAAiB,EAAC,MAAM,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,cAAc,uBAAuB,CAAC;AACtC,OAAO,EAAC,iBAAiB,EAAC,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAC,cAAc,EAAC,MAAM,oBAAoB,CAAC;AAClD,OAAO,EACL,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAC,kBAAkB,EAAC,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EACL,gBAAgB,EAChB,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAC,gBAAgB,EAAE,iBAAiB,EAAC,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useCurrencyFormat: () => (amount: number | string, currencyId: number) => string;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2025 Axelor (<http://axelor.com>).
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
+
* as published by the Free Software Foundation.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import { useCallback } from 'react';
|
|
19
|
+
import { checkNullString, useConfig } from '@axelor/aos-mobile-ui';
|
|
20
|
+
import { useSelector } from '../redux/hooks';
|
|
21
|
+
export const useCurrencyFormat = () => {
|
|
22
|
+
const { nbDecimalDigitForUnitPrice } = useConfig();
|
|
23
|
+
const { currencyList } = useSelector(state => state.core_currency);
|
|
24
|
+
const getNumberOfDecimals = useCallback((currencyId) => currencyList?.find((_c) => _c.id === currencyId)?.numberOfDecimals ??
|
|
25
|
+
nbDecimalDigitForUnitPrice, [currencyList, nbDecimalDigitForUnitPrice]);
|
|
26
|
+
return useCallback((amount, currencyId) => {
|
|
27
|
+
const numberOfDecimals = getNumberOfDecimals(currencyId);
|
|
28
|
+
if (typeof amount === 'number') {
|
|
29
|
+
amount = amount.toString();
|
|
30
|
+
}
|
|
31
|
+
if (checkNullString(amount)) {
|
|
32
|
+
return parseFloat('0').toFixed(numberOfDecimals);
|
|
33
|
+
}
|
|
34
|
+
return parseFloat(amount).toFixed(numberOfDecimals);
|
|
35
|
+
}, [getNumberOfDecimals]);
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=use-currency-formatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-currency-formatter.js","sourceRoot":"","sources":["../../src/hooks/use-currency-formatter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,WAAW,EAAC,MAAM,OAAO,CAAC;AAClC,OAAO,EAAC,eAAe,EAAE,SAAS,EAAC,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAE3C,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,EAAE;IACpC,MAAM,EAAC,0BAA0B,EAAC,GAAG,SAAS,EAAE,CAAC;IAEjD,MAAM,EAAC,YAAY,EAAC,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;IAEjE,MAAM,mBAAmB,GAAG,WAAW,CACrC,CAAC,UAAkB,EAAE,EAAE,CACrB,YAAY,EAAE,IAAI,CAAC,CAAC,EAAO,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,UAAU,CAAC,EAAE,gBAAgB;QACvE,0BAA0B,EAC5B,CAAC,YAAY,EAAE,0BAA0B,CAAC,CAC3C,CAAC;IAEF,OAAO,WAAW,CAChB,CAAC,MAAuB,EAAE,UAAkB,EAAE,EAAE;QAC9C,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,UAAU,CAAC,CAAC;QAEzD,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;YAC9B,MAAM,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;SAC5B;QAED,IAAI,eAAe,CAAC,MAAM,CAAC,EAAE;YAC3B,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;SAClD;QAED,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACtD,CAAC,EACD,CAAC,mBAAmB,CAAC,CACtB,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -15,7 +15,9 @@
|
|
|
15
15
|
* You should have received a copy of the GNU Affero General Public License
|
|
16
16
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
|
+
import { useBasicActions } from '../header';
|
|
18
19
|
export const useHeaderRegisters = headerRegisters => {
|
|
20
|
+
useBasicActions();
|
|
19
21
|
headerRegisters.forEach(_moduleHook => {
|
|
20
22
|
_moduleHook();
|
|
21
23
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-header-registers.js","sourceRoot":"","sources":["../../src/hooks/use-header-registers.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,eAAe,CAAC,EAAE;IAClD,eAAe,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;QACpC,WAAW,EAAE,CAAC;IAChB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"use-header-registers.js","sourceRoot":"","sources":["../../src/hooks/use-header-registers.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,eAAe,EAAC,MAAM,WAAW,CAAC;AAE1C,MAAM,CAAC,MAAM,kBAAkB,GAAG,eAAe,CAAC,EAAE;IAClD,eAAe,EAAE,CAAC;IAClB,eAAe,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;QACpC,WAAW,EAAE,CAAC;IAChB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
interface UseMassScannerParams {
|
|
2
|
+
scanKey: string;
|
|
3
|
+
backgroundAction: (scannedValue: string, tools?: {
|
|
4
|
+
disableScan: () => void;
|
|
5
|
+
}) => any;
|
|
6
|
+
fallbackAction?: (error: any) => void;
|
|
7
|
+
scanInterval?: number;
|
|
8
|
+
disableOnError?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const useMassScanner: ({ scanKey, backgroundAction, fallbackAction, scanInterval, disableOnError, }: UseMassScannerParams) => {
|
|
11
|
+
disableScan: () => void;
|
|
12
|
+
enableScan: () => void;
|
|
13
|
+
isEnabled: boolean;
|
|
14
|
+
};
|
|
15
|
+
export {};
|