@gen-epix/ui-client-common 4.0.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/LICENSE +287 -0
- package/README.md +93 -0
- package/dist/@types/environment.d.ts +7 -0
- package/dist/@types/mui.d.ts +9 -0
- package/dist/@types/ui.d.ts +4 -0
- package/dist/@types/vite-env.d.ts +3 -0
- package/dist/_chunks/ApplicationFooter.js +119 -0
- package/dist/_chunks/ApplicationFooter.js.map +1 -0
- package/dist/_chunks/Breadcrumbs.js +40 -0
- package/dist/_chunks/Breadcrumbs.js.map +1 -0
- package/dist/_chunks/CrudPage.js +535 -0
- package/dist/_chunks/CrudPage.js.map +1 -0
- package/dist/_chunks/GeoFilter.js +38 -0
- package/dist/_chunks/GeoFilter.js.map +1 -0
- package/dist/_chunks/Notifications.js +152 -0
- package/dist/_chunks/Notifications.js.map +1 -0
- package/dist/_chunks/OutageList.js +78 -0
- package/dist/_chunks/OutageList.js.map +1 -0
- package/dist/_chunks/OutageUtil.js +47 -0
- package/dist/_chunks/OutageUtil.js.map +1 -0
- package/dist/_chunks/QueryClientProvider.js +18 -0
- package/dist/_chunks/QueryClientProvider.js.map +1 -0
- package/dist/_chunks/QueryClientService.js +655 -0
- package/dist/_chunks/QueryClientService.js.map +1 -0
- package/dist/_chunks/Table.js +4565 -0
- package/dist/_chunks/Table.js.map +1 -0
- package/dist/_chunks/TableUtil.js +626 -0
- package/dist/_chunks/TableUtil.js.map +1 -0
- package/dist/_chunks/TextFilter.js +249 -0
- package/dist/_chunks/TextFilter.js.map +1 -0
- package/dist/_chunks/UserInvitationsAdminPage.js +273 -0
- package/dist/_chunks/UserInvitationsAdminPage.js.map +1 -0
- package/dist/_chunks/_baseAssignValue.js +19 -0
- package/dist/_chunks/_baseAssignValue.js.map +1 -0
- package/dist/_chunks/_baseFlatten.js +27 -0
- package/dist/_chunks/_baseFlatten.js.map +1 -0
- package/dist/_chunks/_baseGet.js +280 -0
- package/dist/_chunks/_baseGet.js.map +1 -0
- package/dist/_chunks/_baseIteratee.js +275 -0
- package/dist/_chunks/_baseIteratee.js.map +1 -0
- package/dist/_chunks/_baseUnset.js +37 -0
- package/dist/_chunks/_baseUnset.js.map +1 -0
- package/dist/_chunks/_cacheHas.js +65 -0
- package/dist/_chunks/_cacheHas.js.map +1 -0
- package/dist/_chunks/_setToString.js +71 -0
- package/dist/_chunks/_setToString.js.map +1 -0
- package/dist/_chunks/chunk-KS7C4IRE.js +3829 -0
- package/dist/_chunks/chunk-KS7C4IRE.js.map +1 -0
- package/dist/_chunks/format.js +1135 -0
- package/dist/_chunks/format.js.map +1 -0
- package/dist/_chunks/index.esm.js +1179 -0
- package/dist/_chunks/index.esm.js.map +1 -0
- package/dist/_chunks/isArrayLike.js +255 -0
- package/dist/_chunks/isArrayLike.js.map +1 -0
- package/dist/_chunks/isObject.js +13 -0
- package/dist/_chunks/isObject.js.map +1 -0
- package/dist/_chunks/isObjectLike.js +43 -0
- package/dist/_chunks/isObjectLike.js.map +1 -0
- package/dist/_chunks/isSymbol.js +14 -0
- package/dist/_chunks/isSymbol.js.map +1 -0
- package/dist/_chunks/last.js +13 -0
- package/dist/_chunks/last.js.map +1 -0
- package/dist/_chunks/middleware.js +111 -0
- package/dist/_chunks/middleware.js.map +1 -0
- package/dist/_chunks/oidc-client-ts.js +1843 -0
- package/dist/_chunks/oidc-client-ts.js.map +1 -0
- package/dist/_chunks/omit.js +293 -0
- package/dist/_chunks/omit.js.map +1 -0
- package/dist/_chunks/query.js +769 -0
- package/dist/_chunks/query.js.map +1 -0
- package/dist/_chunks/react-oidc-context.js +201 -0
- package/dist/_chunks/react-oidc-context.js.map +1 -0
- package/dist/_chunks/react.js +11 -0
- package/dist/_chunks/react.js.map +1 -0
- package/dist/_chunks/rolldown-runtime.js +13 -0
- package/dist/_chunks/tableStore.js +822 -0
- package/dist/_chunks/tableStore.js.map +1 -0
- package/dist/_chunks/toDate.js +18 -0
- package/dist/_chunks/toDate.js.map +1 -0
- package/dist/_chunks/uniq.js +44 -0
- package/dist/_chunks/uniq.js.map +1 -0
- package/dist/_chunks/useColumnsMenu.js +159 -0
- package/dist/_chunks/useColumnsMenu.js.map +1 -0
- package/dist/_chunks/useMutation.js +110 -0
- package/dist/_chunks/useMutation.js.map +1 -0
- package/dist/_chunks/useQueryMemo.js +325 -0
- package/dist/_chunks/useQueryMemo.js.map +1 -0
- package/dist/_chunks/vanilla.js +20 -0
- package/dist/_chunks/vanilla.js.map +1 -0
- package/dist/_chunks/yup.js +73 -0
- package/dist/_chunks/yup.js.map +1 -0
- package/dist/classes/TableEventBus/TableEventBus.d.ts +12 -0
- package/dist/classes/TableEventBus/index.d.ts +1 -0
- package/dist/classes/TableEventBus/index.js +7 -0
- package/dist/classes/TableEventBus/index.js.map +1 -0
- package/dist/classes/abstracts/FilterAbstract/FilterAbstract.d.ts +27 -0
- package/dist/classes/abstracts/FilterAbstract/index.d.ts +1 -0
- package/dist/classes/abstracts/FilterAbstract/index.js +37 -0
- package/dist/classes/abstracts/FilterAbstract/index.js.map +1 -0
- package/dist/classes/filters/BooleanFilter.d.ts +11 -0
- package/dist/classes/filters/DateFilter.d.ts +26 -0
- package/dist/classes/filters/GeoFilter.d.ts +17 -0
- package/dist/classes/filters/MultiSelectFilter.d.ts +19 -0
- package/dist/classes/filters/NumberRangeFilter.d.ts +17 -0
- package/dist/classes/filters/TextFilter.d.ts +10 -0
- package/dist/classes/filters/index.d.ts +6 -0
- package/dist/classes/filters/index.js +3 -0
- package/dist/classes/services/ApiService/ApiService.d.ts +19 -0
- package/dist/classes/services/ApiService/index.d.ts +1 -0
- package/dist/classes/services/ApiService/index.js +21 -0
- package/dist/classes/services/ApiService/index.js.map +1 -0
- package/dist/classes/services/AuthenticationService/AuthenticationService.d.ts +18 -0
- package/dist/classes/services/AuthenticationService/index.d.ts +1 -0
- package/dist/classes/services/AuthenticationService/index.js +694 -0
- package/dist/classes/services/AuthenticationService/index.js.map +1 -0
- package/dist/classes/services/AuthorizationService/AuthorizationService.d.ts +15 -0
- package/dist/classes/services/AuthorizationService/index.d.ts +1 -0
- package/dist/classes/services/AuthorizationService/index.js +36 -0
- package/dist/classes/services/AuthorizationService/index.js.map +1 -0
- package/dist/classes/services/BackendVersionService/BackendVersionService.d.ts +8 -0
- package/dist/classes/services/BackendVersionService/index.d.ts +1 -0
- package/dist/classes/services/BackendVersionService/index.js +17 -0
- package/dist/classes/services/BackendVersionService/index.js.map +1 -0
- package/dist/classes/services/BreadcrumbService/BreadcrumbService.d.ts +10 -0
- package/dist/classes/services/BreadcrumbService/index.d.ts +1 -0
- package/dist/classes/services/BreadcrumbService/index.js +50 -0
- package/dist/classes/services/BreadcrumbService/index.js.map +1 -0
- package/dist/classes/services/ConfigService/ConfigService.d.ts +9 -0
- package/dist/classes/services/ConfigService/index.d.ts +1 -0
- package/dist/classes/services/ConfigService/index.js +21 -0
- package/dist/classes/services/ConfigService/index.js.map +1 -0
- package/dist/classes/services/EmotionCacheService/EmotionCacheService.d.ts +7 -0
- package/dist/classes/services/EmotionCacheService/index.d.ts +1 -0
- package/dist/classes/services/EmotionCacheService/index.js +24 -0
- package/dist/classes/services/EmotionCacheService/index.js.map +1 -0
- package/dist/classes/services/FeatureFlagsService/FeatureFlagsService.d.ts +9 -0
- package/dist/classes/services/FeatureFlagsService/index.d.ts +1 -0
- package/dist/classes/services/FeatureFlagsService/index.js +21 -0
- package/dist/classes/services/FeatureFlagsService/index.js.map +1 -0
- package/dist/classes/services/I18nService/I18nService.d.ts +28 -0
- package/dist/classes/services/I18nService/index.d.ts +1 -0
- package/dist/classes/services/I18nService/index.js +67 -0
- package/dist/classes/services/I18nService/index.js.map +1 -0
- package/dist/classes/services/InactivityService/InactivityService.d.ts +25 -0
- package/dist/classes/services/InactivityService/index.d.ts +1 -0
- package/dist/classes/services/InactivityService/index.js +172 -0
- package/dist/classes/services/InactivityService/index.js.map +1 -0
- package/dist/classes/services/LogService/LogService.d.ts +22 -0
- package/dist/classes/services/LogService/index.d.ts +1 -0
- package/dist/classes/services/LogService/index.js +92 -0
- package/dist/classes/services/LogService/index.js.map +1 -0
- package/dist/classes/services/NavigationHistoryService/NavigationHistoryService.d.ts +6 -0
- package/dist/classes/services/NavigationHistoryService/index.d.ts +1 -0
- package/dist/classes/services/NavigationHistoryService/index.js +14 -0
- package/dist/classes/services/NavigationHistoryService/index.js.map +1 -0
- package/dist/classes/services/NotificationService/NotificationService.d.ts +14 -0
- package/dist/classes/services/NotificationService/index.d.ts +1 -0
- package/dist/classes/services/NotificationService/index.js +63 -0
- package/dist/classes/services/NotificationService/index.js.map +1 -0
- package/dist/classes/services/PageEventBusService/PageEventBusService.d.ts +28 -0
- package/dist/classes/services/PageEventBusService/index.d.ts +1 -0
- package/dist/classes/services/PageEventBusService/index.js +66 -0
- package/dist/classes/services/PageEventBusService/index.js.map +1 -0
- package/dist/classes/services/QueryClientService/QueryClientService.d.ts +25 -0
- package/dist/classes/services/QueryClientService/index.d.ts +1 -0
- package/dist/classes/services/QueryClientService/index.js +2 -0
- package/dist/classes/services/RouterService/RouterService.d.ts +19 -0
- package/dist/classes/services/RouterService/index.d.ts +1 -0
- package/dist/classes/services/RouterService/index.js +22 -0
- package/dist/classes/services/RouterService/index.js.map +1 -0
- package/dist/classes/services/UserSettingsService/UserSettingsService.d.ts +6 -0
- package/dist/classes/services/UserSettingsService/index.d.ts +1 -0
- package/dist/classes/services/UserSettingsService/index.js +14 -0
- package/dist/classes/services/UserSettingsService/index.js.map +1 -0
- package/dist/components/app/App/App.d.ts +1 -0
- package/dist/components/app/App/index.d.ts +1 -0
- package/dist/components/app/App/index.js +106 -0
- package/dist/components/app/App/index.js.map +1 -0
- package/dist/components/app/ApplicationBootstrap/ApplicationBootstrap.d.ts +2 -0
- package/dist/components/app/ApplicationBootstrap/index.d.ts +1 -0
- package/dist/components/app/ApplicationBootstrap/index.js +135 -0
- package/dist/components/app/ApplicationBootstrap/index.js.map +1 -0
- package/dist/components/app/AuthenticationWrapper/AuthenticationWrapper.d.ts +2 -0
- package/dist/components/app/AuthenticationWrapper/index.d.ts +1 -0
- package/dist/components/app/AuthenticationWrapper/index.js +126 -0
- package/dist/components/app/AuthenticationWrapper/index.js.map +1 -0
- package/dist/components/app/AuthorizationWrapper/AuthorizationWrapper.d.ts +2 -0
- package/dist/components/app/AuthorizationWrapper/index.d.ts +1 -0
- package/dist/components/app/AuthorizationWrapper/index.js +46 -0
- package/dist/components/app/AuthorizationWrapper/index.js.map +1 -0
- package/dist/components/app/RouterRoot/RouterRoot.d.ts +1 -0
- package/dist/components/app/RouterRoot/index.d.ts +1 -0
- package/dist/components/app/RouterRoot/index.js +118 -0
- package/dist/components/app/RouterRoot/index.js.map +1 -0
- package/dist/components/epi/EpiContactDetailsDialog/EpiContactDetailsDialog.d.ts +9 -0
- package/dist/components/epi/EpiContactDetailsDialog/index.d.ts +1 -0
- package/dist/components/epi/EpiContactDetailsDialog/index.js +81 -0
- package/dist/components/epi/EpiContactDetailsDialog/index.js.map +1 -0
- package/dist/components/filters/BooleanFilterField/BooleanFilterField.d.ts +5 -0
- package/dist/components/filters/BooleanFilterField/index.d.ts +1 -0
- package/dist/components/filters/BooleanFilterField/index.js +23 -0
- package/dist/components/filters/BooleanFilterField/index.js.map +1 -0
- package/dist/components/filters/DateFilterField/DateFilterField.d.ts +5 -0
- package/dist/components/filters/DateFilterField/index.d.ts +1 -0
- package/dist/components/filters/DateFilterField/index.js +15 -0
- package/dist/components/filters/DateFilterField/index.js.map +1 -0
- package/dist/components/filters/GeoFilterField/GeoFilterField.d.ts +5 -0
- package/dist/components/filters/GeoFilterField/index.d.ts +1 -0
- package/dist/components/filters/GeoFilterField/index.js +20 -0
- package/dist/components/filters/GeoFilterField/index.js.map +1 -0
- package/dist/components/filters/MultiSelectFilterField/MultiSelectFilterField.d.ts +5 -0
- package/dist/components/filters/MultiSelectFilterField/index.d.ts +1 -0
- package/dist/components/filters/MultiSelectFilterField/index.js +19 -0
- package/dist/components/filters/MultiSelectFilterField/index.js.map +1 -0
- package/dist/components/filters/NumberRangeFilterField/NumberRangeFilterField.d.ts +5 -0
- package/dist/components/filters/NumberRangeFilterField/index.d.ts +1 -0
- package/dist/components/filters/NumberRangeFilterField/index.js +14 -0
- package/dist/components/filters/NumberRangeFilterField/index.js.map +1 -0
- package/dist/components/filters/TextFilterField/TextFilterField.d.ts +5 -0
- package/dist/components/filters/TextFilterField/index.d.ts +1 -0
- package/dist/components/filters/TextFilterField/index.js +12 -0
- package/dist/components/filters/TextFilterField/index.js.map +1 -0
- package/dist/components/ui/ApplicationBar/ApplicationBar.d.ts +6 -0
- package/dist/components/ui/ApplicationBar/ApplicationBarActions.d.ts +4 -0
- package/dist/components/ui/ApplicationBar/ApplicationBarActionsFeedbackItem.d.ts +1 -0
- package/dist/components/ui/ApplicationBar/ApplicationBarActionsInfotem.d.ts +1 -0
- package/dist/components/ui/ApplicationBar/ApplicationBarActionsNotificationsItem.d.ts +1 -0
- package/dist/components/ui/ApplicationBar/ApplicationBarActionsOrganizationSwitcherItem.d.ts +1 -0
- package/dist/components/ui/ApplicationBar/ApplicationBarActionsOutagesItem.d.ts +1 -0
- package/dist/components/ui/ApplicationBar/ApplicationBarActionsUserItem.d.ts +1 -0
- package/dist/components/ui/ApplicationBar/ApplicationBarNavigationMenu.d.ts +4 -0
- package/dist/components/ui/ApplicationBar/InfoMenu.d.ts +7 -0
- package/dist/components/ui/ApplicationBar/UserMenu.d.ts +7 -0
- package/dist/components/ui/ApplicationBar/UserOrganizationAdminMenuItem.d.ts +4 -0
- package/dist/components/ui/ApplicationBar/UserOwnOrganizationMenuItem.d.ts +4 -0
- package/dist/components/ui/ApplicationBar/index.d.ts +1 -0
- package/dist/components/ui/ApplicationBar/index.js +661 -0
- package/dist/components/ui/ApplicationBar/index.js.map +1 -0
- package/dist/components/ui/ApplicationFooter/ApplicationFooter.d.ts +4 -0
- package/dist/components/ui/ApplicationFooter/ApplicationFooterLink.d.ts +7 -0
- package/dist/components/ui/ApplicationFooter/ApplicationFooterLinkSection.d.ts +5 -0
- package/dist/components/ui/ApplicationFooter/index.d.ts +1 -0
- package/dist/components/ui/ApplicationFooter/index.js +2 -0
- package/dist/components/ui/BackdropSpinner/BackdropSpinner.d.ts +5 -0
- package/dist/components/ui/BackdropSpinner/index.d.ts +1 -0
- package/dist/components/ui/BackdropSpinner/index.js +19 -0
- package/dist/components/ui/BackdropSpinner/index.js.map +1 -0
- package/dist/components/ui/Breadcrumbs/Breadcrumb.d.ts +9 -0
- package/dist/components/ui/Breadcrumbs/Breadcrumbs.d.ts +1 -0
- package/dist/components/ui/Breadcrumbs/index.d.ts +1 -0
- package/dist/components/ui/Breadcrumbs/index.js +2 -0
- package/dist/components/ui/Confirmation/Confirmation.d.ts +2 -0
- package/dist/components/ui/Confirmation/ConfirmationRender.d.ts +11 -0
- package/dist/components/ui/Confirmation/index.d.ts +2 -0
- package/dist/components/ui/Confirmation/index.js +58 -0
- package/dist/components/ui/Confirmation/index.js.map +1 -0
- package/dist/components/ui/ConsentDialog/ConsentDialog.d.ts +8 -0
- package/dist/components/ui/ConsentDialog/index.d.ts +1 -0
- package/dist/components/ui/ConsentDialog/index.js +36 -0
- package/dist/components/ui/ConsentDialog/index.js.map +1 -0
- package/dist/components/ui/CopyToClipboardButton/CopyToClipboardButton.d.ts +13 -0
- package/dist/components/ui/CopyToClipboardButton/index.d.ts +1 -0
- package/dist/components/ui/CopyToClipboardButton/index.js +101 -0
- package/dist/components/ui/CopyToClipboardButton/index.js.map +1 -0
- package/dist/components/ui/Dialog/Dialog.d.ts +27 -0
- package/dist/components/ui/Dialog/index.d.ts +1 -0
- package/dist/components/ui/Dialog/index.js +83 -0
- package/dist/components/ui/Dialog/index.js.map +1 -0
- package/dist/components/ui/GenericErrorMessage/GenericErrorMessage.d.ts +5 -0
- package/dist/components/ui/GenericErrorMessage/index.d.ts +1 -0
- package/dist/components/ui/GenericErrorMessage/index.js +91 -0
- package/dist/components/ui/GenericErrorMessage/index.js.map +1 -0
- package/dist/components/ui/LicensesDialog/LicensesDialog.d.ts +7 -0
- package/dist/components/ui/LicensesDialog/index.d.ts +1 -0
- package/dist/components/ui/LicensesDialog/index.js +117 -0
- package/dist/components/ui/LicensesDialog/index.js.map +1 -0
- package/dist/components/ui/LinearProgressWithLabel/LinearProgressWithLabel.d.ts +5 -0
- package/dist/components/ui/LinearProgressWithLabel/index.d.ts +1 -0
- package/dist/components/ui/LinearProgressWithLabel/index.js +31 -0
- package/dist/components/ui/LinearProgressWithLabel/index.js.map +1 -0
- package/dist/components/ui/LoadingIndicator/LoadingIndicator.d.ts +2 -0
- package/dist/components/ui/LoadingIndicator/index.d.ts +1 -0
- package/dist/components/ui/LoadingIndicator/index.js +12 -0
- package/dist/components/ui/LoadingIndicator/index.js.map +1 -0
- package/dist/components/ui/MyPermissionsDialog/MyPermissionsDialog.d.ts +7 -0
- package/dist/components/ui/MyPermissionsDialog/index.d.ts +1 -0
- package/dist/components/ui/MyPermissionsDialog/index.js +41 -0
- package/dist/components/ui/MyPermissionsDialog/index.js.map +1 -0
- package/dist/components/ui/NavLink/NavLink.d.ts +7 -0
- package/dist/components/ui/NavLink/index.d.ts +1 -0
- package/dist/components/ui/NavLink/index.js +23 -0
- package/dist/components/ui/NavLink/index.js.map +1 -0
- package/dist/components/ui/NestedMenu/IconMenuItem.d.ts +18 -0
- package/dist/components/ui/NestedMenu/NestedDropdown.d.ts +17 -0
- package/dist/components/ui/NestedMenu/NestedMenuItem.d.ts +22 -0
- package/dist/components/ui/NestedMenu/index.d.ts +4 -0
- package/dist/components/ui/NestedMenu/index.js +240 -0
- package/dist/components/ui/NestedMenu/index.js.map +1 -0
- package/dist/components/ui/NestedMenu/nestedMenuItemsFromObject.d.ts +11 -0
- package/dist/components/ui/Notifications/NotificationItem.d.ts +8 -0
- package/dist/components/ui/Notifications/NotificationsDrawer.d.ts +5 -0
- package/dist/components/ui/Notifications/NotificationsStack.d.ts +2 -0
- package/dist/components/ui/Notifications/index.d.ts +2 -0
- package/dist/components/ui/Notifications/index.js +2 -0
- package/dist/components/ui/OrganizationSwitcherDialog/OrganizationSwitcherDialog.d.ts +7 -0
- package/dist/components/ui/OrganizationSwitcherDialog/index.d.ts +1 -0
- package/dist/components/ui/OrganizationSwitcherDialog/index.js +123 -0
- package/dist/components/ui/OrganizationSwitcherDialog/index.js.map +1 -0
- package/dist/components/ui/OutageList/OutageItem.d.ts +9 -0
- package/dist/components/ui/OutageList/OutageList.d.ts +7 -0
- package/dist/components/ui/OutageList/OutageSection.d.ts +10 -0
- package/dist/components/ui/OutageList/index.d.ts +1 -0
- package/dist/components/ui/OutageList/index.js +2 -0
- package/dist/components/ui/OutagesDialog/OutagesDialog.d.ts +7 -0
- package/dist/components/ui/OutagesDialog/index.d.ts +1 -0
- package/dist/components/ui/OutagesDialog/index.js +43 -0
- package/dist/components/ui/OutagesDialog/index.js.map +1 -0
- package/dist/components/ui/PageContainer/PageContainer.d.ts +14 -0
- package/dist/components/ui/PageContainer/index.d.ts +1 -0
- package/dist/components/ui/PageContainer/index.js +135 -0
- package/dist/components/ui/PageContainer/index.js.map +1 -0
- package/dist/components/ui/ResponseHandler/ResponseHandler.d.ts +16 -0
- package/dist/components/ui/ResponseHandler/index.d.ts +1 -0
- package/dist/components/ui/ResponseHandler/index.js +28 -0
- package/dist/components/ui/ResponseHandler/index.js.map +1 -0
- package/dist/components/ui/Sidebar/SidebarItem.d.ts +13 -0
- package/dist/components/ui/Sidebar/SidebarMenu.d.ts +3 -0
- package/dist/components/ui/Sidebar/SidebarMenuItem.d.ts +12 -0
- package/dist/components/ui/Sidebar/index.d.ts +3 -0
- package/dist/components/ui/Sidebar/index.js +128 -0
- package/dist/components/ui/Sidebar/index.js.map +1 -0
- package/dist/components/ui/SortableList/SortableList.d.ts +14 -0
- package/dist/components/ui/SortableList/SortableListItem.d.ts +8 -0
- package/dist/components/ui/SortableList/SortableListItemDragHandle.d.ts +4 -0
- package/dist/components/ui/SortableList/SortableOverlay.d.ts +2 -0
- package/dist/components/ui/SortableList/context/SortableListItemContext.d.ts +7 -0
- package/dist/components/ui/SortableList/context/SortableListItemContextProvider.d.ts +6 -0
- package/dist/components/ui/SortableList/context/useSortableListItemContext.d.ts +1 -0
- package/dist/components/ui/Spinner/Spinner.d.ts +11 -0
- package/dist/components/ui/Spinner/index.d.ts +1 -0
- package/dist/components/ui/Spinner/index.js +63 -0
- package/dist/components/ui/Spinner/index.js.map +1 -0
- package/dist/components/ui/Stepper/Stepper.d.ts +17 -0
- package/dist/components/ui/Stepper/index.d.ts +2 -0
- package/dist/components/ui/Stepper/index.js +126 -0
- package/dist/components/ui/Stepper/index.js.map +1 -0
- package/dist/components/ui/Stepper/stepperModel.d.ts +4 -0
- package/dist/components/ui/Table/Table.d.ts +30 -0
- package/dist/components/ui/Table/TableActionsCell.d.ts +6 -0
- package/dist/components/ui/Table/TableCaption.d.ts +7 -0
- package/dist/components/ui/Table/TableCell.d.ts +27 -0
- package/dist/components/ui/Table/TableCellAsyncContent.d.ts +4 -0
- package/dist/components/ui/Table/TableCheckboxCell.d.ts +8 -0
- package/dist/components/ui/Table/TableCheckboxHeader.d.ts +5 -0
- package/dist/components/ui/Table/TableColumnsEditorDialog.d.ts +9 -0
- package/dist/components/ui/Table/TableFilter.d.ts +6 -0
- package/dist/components/ui/Table/TableFiltersSidebarItem.d.ts +9 -0
- package/dist/components/ui/Table/TableHeader.d.ts +8 -0
- package/dist/components/ui/Table/TableHeaderCell.d.ts +9 -0
- package/dist/components/ui/Table/TableHeaderFilter.d.ts +7 -0
- package/dist/components/ui/Table/TableMenu.d.ts +5 -0
- package/dist/components/ui/Table/TableReadableIndexCell.d.ts +8 -0
- package/dist/components/ui/Table/TableSidebarMenu.d.ts +5 -0
- package/dist/components/ui/Table/classNames.d.ts +8 -0
- package/dist/components/ui/Table/index.d.ts +12 -0
- package/dist/components/ui/Table/index.js +2 -0
- package/dist/components/ui/UserFeedbackDialog/UserFeedbackDialog.d.ts +7 -0
- package/dist/components/ui/UserFeedbackDialog/index.d.ts +1 -0
- package/dist/components/ui/UserFeedbackDialog/index.js +117 -0
- package/dist/components/ui/UserFeedbackDialog/index.js.map +1 -0
- package/dist/components/ui/UserInactivityConfirmation/UserInactivityConfirmation.d.ts +1 -0
- package/dist/components/ui/UserInactivityConfirmation/index.d.ts +1 -0
- package/dist/components/ui/UserInactivityConfirmation/index.js +40 -0
- package/dist/components/ui/UserInactivityConfirmation/index.js.map +1 -0
- package/dist/constants/query.d.ts +21 -0
- package/dist/constants/query.js +46 -0
- package/dist/constants/query.js.map +1 -0
- package/dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/index.d.ts +1 -0
- package/dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/index.js +26 -0
- package/dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/index.js.map +1 -0
- package/dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/useIdentifierIssuerOwnOrganizationQuery.d.ts +5 -0
- package/dist/dataHooks/useIdentifierIssuerQuery/index.d.ts +1 -0
- package/dist/dataHooks/useIdentifierIssuerQuery/index.js +22 -0
- package/dist/dataHooks/useIdentifierIssuerQuery/index.js.map +1 -0
- package/dist/dataHooks/useIdentifierIssuerQuery/useIdentifierIssuerQuery.d.ts +8 -0
- package/dist/dataHooks/useInviteUserConstraintsQuery/index.d.ts +1 -0
- package/dist/dataHooks/useInviteUserConstraintsQuery/index.js +21 -0
- package/dist/dataHooks/useInviteUserConstraintsQuery/index.js.map +1 -0
- package/dist/dataHooks/useInviteUserConstraintsQuery/useInviteUserConstraintsQuery.d.ts +3 -0
- package/dist/dataHooks/useOrganizationAdminPoliciesQuery/index.d.ts +1 -0
- package/dist/dataHooks/useOrganizationAdminPoliciesQuery/index.js +32 -0
- package/dist/dataHooks/useOrganizationAdminPoliciesQuery/index.js.map +1 -0
- package/dist/dataHooks/useOrganizationAdminPoliciesQuery/useOrganizationAdminPoliciesQuery.d.ts +7 -0
- package/dist/dataHooks/useOrganizationIdentifierIssuerLinksQuery/index.d.ts +1 -0
- package/dist/dataHooks/useOrganizationIdentifierIssuerLinksQuery/index.js +13 -0
- package/dist/dataHooks/useOrganizationIdentifierIssuerLinksQuery/index.js.map +1 -0
- package/dist/dataHooks/useOrganizationIdentifierIssuerLinksQuery/useOrganizationIdentifierIssuerLinksQuery.d.ts +3 -0
- package/dist/dataHooks/useOrganizationsQuery/index.d.ts +1 -0
- package/dist/dataHooks/useOrganizationsQuery/index.js +22 -0
- package/dist/dataHooks/useOrganizationsQuery/index.js.map +1 -0
- package/dist/dataHooks/useOrganizationsQuery/useOrganizationsQuery.d.ts +6 -0
- package/dist/dataHooks/useUsersQuery/index.d.ts +1 -0
- package/dist/dataHooks/useUsersQuery/index.js +23 -0
- package/dist/dataHooks/useUsersQuery/index.js.map +1 -0
- package/dist/dataHooks/useUsersQuery/useUsersQuery.d.ts +6 -0
- package/dist/hoc/withDialog/index.d.ts +1 -0
- package/dist/hoc/withDialog/index.js +69 -0
- package/dist/hoc/withDialog/index.js.map +1 -0
- package/dist/hoc/withDialog/withDialog.d.ts +33 -0
- package/dist/hoc/withPermissions/index.d.ts +1 -0
- package/dist/hoc/withPermissions/index.js +21 -0
- package/dist/hoc/withPermissions/index.js.map +1 -0
- package/dist/hoc/withPermissions/withPermissions.d.ts +10 -0
- package/dist/hooks/useColumnsMenu/index.d.ts +1 -0
- package/dist/hooks/useColumnsMenu/index.js +2 -0
- package/dist/hooks/useColumnsMenu/useColumnsMenu.d.ts +6 -0
- package/dist/hooks/useCreateMutation/index.d.ts +1 -0
- package/dist/hooks/useCreateMutation/index.js +50 -0
- package/dist/hooks/useCreateMutation/index.js.map +1 -0
- package/dist/hooks/useCreateMutation/useCreateMutation.d.ts +21 -0
- package/dist/hooks/useDeleteMutation/index.d.ts +1 -0
- package/dist/hooks/useDeleteMutation/index.js +41 -0
- package/dist/hooks/useDeleteMutation/index.js.map +1 -0
- package/dist/hooks/useDeleteMutation/useDeleteMutation.d.ts +20 -0
- package/dist/hooks/useEditMutation/index.d.ts +1 -0
- package/dist/hooks/useEditMutation/index.js +57 -0
- package/dist/hooks/useEditMutation/index.js.map +1 -0
- package/dist/hooks/useEditMutation/useEditMutation.d.ts +23 -0
- package/dist/hooks/useInitializeTableStore/index.d.ts +1 -0
- package/dist/hooks/useInitializeTableStore/index.js +28 -0
- package/dist/hooks/useInitializeTableStore/index.js.map +1 -0
- package/dist/hooks/useInitializeTableStore/useInitializeTableStore.d.ts +11 -0
- package/dist/hooks/useItemQuery/index.d.ts +1 -0
- package/dist/hooks/useItemQuery/index.js +61 -0
- package/dist/hooks/useItemQuery/index.js.map +1 -0
- package/dist/hooks/useItemQuery/useItemQuery.d.ts +15 -0
- package/dist/hooks/useQueryMemo/index.d.ts +1 -0
- package/dist/hooks/useQueryMemo/index.js +2 -0
- package/dist/hooks/useQueryMemo/useQueryMemo.d.ts +2 -0
- package/dist/hooks/useUpdateBreadcrumb/index.d.ts +1 -0
- package/dist/hooks/useUpdateBreadcrumb/index.js +15 -0
- package/dist/hooks/useUpdateBreadcrumb/index.js.map +1 -0
- package/dist/hooks/useUpdateBreadcrumb/useUpdateBreadcrumb.d.ts +1 -0
- package/dist/hooks/useUpdateDocumentTitle/index.d.ts +1 -0
- package/dist/hooks/useUpdateDocumentTitle/index.js +12 -0
- package/dist/hooks/useUpdateDocumentTitle/index.js.map +1 -0
- package/dist/hooks/useUpdateDocumentTitle/useUpdateDocumentTitle.d.ts +1 -0
- package/dist/locale/en.json +294 -0
- package/dist/locale/nl.json +294 -0
- package/dist/models/admin.d.ts +7 -0
- package/dist/models/admin.js +8 -0
- package/dist/models/admin.js.map +1 -0
- package/dist/models/api.d.ts +9 -0
- package/dist/models/api.js +0 -0
- package/dist/models/auth.d.ts +11 -0
- package/dist/models/auth.js +0 -0
- package/dist/models/config.d.ts +77 -0
- package/dist/models/config.js +0 -0
- package/dist/models/data.d.ts +10 -0
- package/dist/models/data.js +0 -0
- package/dist/models/dataHooks.d.ts +17 -0
- package/dist/models/dataHooks.js +0 -0
- package/dist/models/filter.d.ts +34 -0
- package/dist/models/filter.js +0 -0
- package/dist/models/nestedMenu.d.ts +17 -0
- package/dist/models/nestedMenu.js +0 -0
- package/dist/models/notification.d.ts +11 -0
- package/dist/models/notification.js +0 -0
- package/dist/models/outage.d.ts +6 -0
- package/dist/models/outage.js +0 -0
- package/dist/models/reactRouter.d.ts +25 -0
- package/dist/models/reactRouter.js +0 -0
- package/dist/models/table.d.ts +149 -0
- package/dist/models/table.js +10 -0
- package/dist/models/table.js.map +1 -0
- package/dist/models/theme.d.ts +17 -0
- package/dist/models/theme.js +0 -0
- package/dist/pages/AcceptInvitationPage/AcceptInvitationPage.d.ts +1 -0
- package/dist/pages/AcceptInvitationPage/index.d.ts +1 -0
- package/dist/pages/AcceptInvitationPage/index.js +61 -0
- package/dist/pages/AcceptInvitationPage/index.js.map +1 -0
- package/dist/pages/AdminPage/AdminPage.d.ts +1 -0
- package/dist/pages/AdminPage/index.d.ts +1 -0
- package/dist/pages/AdminPage/index.js +83 -0
- package/dist/pages/AdminPage/index.js.map +1 -0
- package/dist/pages/ChooseIdentityProviderPage/ChooseIdentityProviderPage.d.ts +5 -0
- package/dist/pages/ChooseIdentityProviderPage/index.d.ts +1 -0
- package/dist/pages/ChooseIdentityProviderPage/index.js +85 -0
- package/dist/pages/ChooseIdentityProviderPage/index.js.map +1 -0
- package/dist/pages/CrudPage/CrudPage.d.ts +75 -0
- package/dist/pages/CrudPage/CrudPageDeleteDialog.d.ts +12 -0
- package/dist/pages/CrudPage/CrudPageEditDialog.d.ts +23 -0
- package/dist/pages/CrudPage/index.d.ts +1 -0
- package/dist/pages/CrudPage/index.js +2 -0
- package/dist/pages/ErrorPage/ErrorPage.d.ts +4 -0
- package/dist/pages/ErrorPage/index.d.ts +1 -0
- package/dist/pages/ErrorPage/index.js +19 -0
- package/dist/pages/ErrorPage/index.js.map +1 -0
- package/dist/pages/IdentifierIssuersAdminPage/IdentifierIssuersAdminPage.d.ts +1 -0
- package/dist/pages/IdentifierIssuersAdminPage/index.d.ts +1 -0
- package/dist/pages/IdentifierIssuersAdminPage/index.js +69 -0
- package/dist/pages/IdentifierIssuersAdminPage/index.js.map +1 -0
- package/dist/pages/OrganizationAdminPoliciesAdminPage/OrganizationAdminPoliciesAdminPage.d.ts +1 -0
- package/dist/pages/OrganizationAdminPoliciesAdminPage/index.d.ts +1 -0
- package/dist/pages/OrganizationAdminPoliciesAdminPage/index.js +98 -0
- package/dist/pages/OrganizationAdminPoliciesAdminPage/index.js.map +1 -0
- package/dist/pages/OrganizationContactsAdminPage/OrganizationContactsAdminPage.d.ts +1 -0
- package/dist/pages/OrganizationContactsAdminPage/index.d.ts +1 -0
- package/dist/pages/OrganizationContactsAdminPage/index.js +86 -0
- package/dist/pages/OrganizationContactsAdminPage/index.js.map +1 -0
- package/dist/pages/OrganizationSitesAdminPage/OrganizationSitesAdminPage.d.ts +1 -0
- package/dist/pages/OrganizationSitesAdminPage/index.d.ts +1 -0
- package/dist/pages/OrganizationSitesAdminPage/index.js +68 -0
- package/dist/pages/OrganizationSitesAdminPage/index.js.map +1 -0
- package/dist/pages/OrganizationsAdminPage/OrganizationsAdminPage.d.ts +1 -0
- package/dist/pages/OrganizationsAdminPage/index.d.ts +1 -0
- package/dist/pages/OrganizationsAdminPage/index.js +132 -0
- package/dist/pages/OrganizationsAdminPage/index.js.map +1 -0
- package/dist/pages/OutagesAdminPage/OutagesAdminPage.d.ts +1 -0
- package/dist/pages/OutagesAdminPage/index.d.ts +1 -0
- package/dist/pages/OutagesAdminPage/index.js +133 -0
- package/dist/pages/OutagesAdminPage/index.js.map +1 -0
- package/dist/pages/PostLoginPage/PostLoginPage.d.ts +1 -0
- package/dist/pages/PostLoginPage/index.d.ts +1 -0
- package/dist/pages/PostLoginPage/index.js +26 -0
- package/dist/pages/PostLoginPage/index.js.map +1 -0
- package/dist/pages/PostLogoutPage/PostLogoutPage.d.ts +1 -0
- package/dist/pages/PostLogoutPage/index.d.ts +1 -0
- package/dist/pages/PostLogoutPage/index.js +32 -0
- package/dist/pages/PostLogoutPage/index.js.map +1 -0
- package/dist/pages/RouterErrorPage/RouterErrorPage.d.ts +1 -0
- package/dist/pages/RouterErrorPage/index.d.ts +1 -0
- package/dist/pages/RouterErrorPage/index.js +20 -0
- package/dist/pages/RouterErrorPage/index.js.map +1 -0
- package/dist/pages/UserInvitationsAdminPage/UserInvitationConsumeDialog.d.ts +9 -0
- package/dist/pages/UserInvitationsAdminPage/UserInvitationShareDialog.d.ts +9 -0
- package/dist/pages/UserInvitationsAdminPage/UserInvitationsAdminPage.d.ts +1 -0
- package/dist/pages/UserInvitationsAdminPage/index.d.ts +1 -0
- package/dist/pages/UserInvitationsAdminPage/index.js +2 -0
- package/dist/pages/UsersAdminPage/UsersAdminPage.d.ts +7 -0
- package/dist/pages/UsersAdminPage/index.d.ts +1 -0
- package/dist/pages/UsersAdminPage/index.js +206 -0
- package/dist/pages/UsersAdminPage/index.js.map +1 -0
- package/dist/routes/adminRoutes.d.ts +9 -0
- package/dist/routes/index.d.ts +2 -0
- package/dist/routes/index.js +258 -0
- package/dist/routes/index.js.map +1 -0
- package/dist/routes/routes.d.ts +8 -0
- package/dist/setup/setup.d.ts +1 -0
- package/dist/setup/setup.js +9 -0
- package/dist/setup/setup.js.map +1 -0
- package/dist/stores/oidcStore/index.d.ts +1 -0
- package/dist/stores/oidcStore/index.js +18 -0
- package/dist/stores/oidcStore/index.js.map +1 -0
- package/dist/stores/oidcStore/oidcStore.d.ts +22 -0
- package/dist/stores/outagesStore/index.d.ts +1 -0
- package/dist/stores/outagesStore/index.js +16 -0
- package/dist/stores/outagesStore/index.js.map +1 -0
- package/dist/stores/outagesStore/outagesStore.d.ts +12 -0
- package/dist/stores/tableStore/TableStoreContext.d.ts +3 -0
- package/dist/stores/tableStore/TableStoreContextProvider.d.ts +7 -0
- package/dist/stores/tableStore/index.d.ts +4 -0
- package/dist/stores/tableStore/index.js +2 -0
- package/dist/stores/tableStore/tableStore.d.ts +102 -0
- package/dist/stores/tableStore/useTableStoreContext.d.ts +3 -0
- package/dist/test/lib/index.d.ts +1 -0
- package/dist/test/lib/render.d.ts +2 -0
- package/dist/theme/demoTheme/demoTheme.d.ts +3 -0
- package/dist/theme/demoTheme/index.d.ts +1 -0
- package/dist/theme/demoTheme/index.js +337 -0
- package/dist/theme/demoTheme/index.js.map +1 -0
- package/dist/utils/AxiosUtil/AxiosUtil.d.ts +13 -0
- package/dist/utils/AxiosUtil/index.d.ts +1 -0
- package/dist/utils/AxiosUtil/index.js +38 -0
- package/dist/utils/AxiosUtil/index.js.map +1 -0
- package/dist/utils/DataHookUtil/DataHookUtil.d.ts +8 -0
- package/dist/utils/DataHookUtil/index.d.ts +1 -0
- package/dist/utils/DataHookUtil/index.js +77 -0
- package/dist/utils/DataHookUtil/index.js.map +1 -0
- package/dist/utils/LoadableUtil/LoadableUtil.d.ts +9 -0
- package/dist/utils/LoadableUtil/index.d.ts +1 -0
- package/dist/utils/LoadableUtil/index.js +25 -0
- package/dist/utils/LoadableUtil/index.js.map +1 -0
- package/dist/utils/MenuDataUtil/MenuDataUtil.d.ts +5 -0
- package/dist/utils/MenuDataUtil/index.d.ts +1 -0
- package/dist/utils/MenuDataUtil/index.js +19 -0
- package/dist/utils/MenuDataUtil/index.js.map +1 -0
- package/dist/utils/NotificationUtil/NotificationUtil.d.ts +4 -0
- package/dist/utils/NotificationUtil/index.d.ts +1 -0
- package/dist/utils/NotificationUtil/index.js +12 -0
- package/dist/utils/NotificationUtil/index.js.map +1 -0
- package/dist/utils/OutageUtil/OutageUtil.d.ts +5 -0
- package/dist/utils/OutageUtil/index.d.ts +1 -0
- package/dist/utils/OutageUtil/index.js +2 -0
- package/dist/utils/StandardConfigUtil/StandardConfigUtil.d.ts +4 -0
- package/dist/utils/StandardConfigUtil/index.d.ts +1 -0
- package/dist/utils/StandardConfigUtil/index.js +76 -0
- package/dist/utils/StandardConfigUtil/index.js.map +1 -0
- package/dist/utils/TableUtil/TableUtil.d.ts +90 -0
- package/dist/utils/TableUtil/index.d.ts +1 -0
- package/dist/utils/TableUtil/index.js +2 -0
- package/dist/utils/TimeUtil/TimeUtil.d.ts +3 -0
- package/dist/utils/TimeUtil/index.d.ts +1 -0
- package/dist/utils/TimeUtil/index.js +19 -0
- package/dist/utils/TimeUtil/index.js.map +1 -0
- package/dist/utils/UserManagerUtil/UserManagerUtil.d.ts +6 -0
- package/dist/utils/UserManagerUtil/index.d.ts +1 -0
- package/dist/utils/UserManagerUtil/index.js +31 -0
- package/dist/utils/UserManagerUtil/index.js.map +1 -0
- package/dist/utils/UserUtil/UserUtil.d.ts +5 -0
- package/dist/utils/UserUtil/index.d.ts +1 -0
- package/dist/utils/UserUtil/index.js +10 -0
- package/dist/utils/UserUtil/index.js.map +1 -0
- package/package.json +585 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { WindowService as e } from "@gen-epix/ui-core/classes/services/WindowService";
|
|
2
|
+
import t, { changeLanguage as n, use as r } from "i18next";
|
|
3
|
+
import { HmrUtil as i } from "@gen-epix/ui-core/utils/HmrUtil";
|
|
4
|
+
import { EventBusAbstract as a } from "@gen-epix/ui-core/classes/abstracts/EventBusAbstract";
|
|
5
|
+
import { initReactI18next as o } from "react-i18next";
|
|
6
|
+
//#region src/classes/services/I18nService/I18nService.ts
|
|
7
|
+
var s = class s extends a {
|
|
8
|
+
static __instance;
|
|
9
|
+
getCurrentLanguageCode;
|
|
10
|
+
isInitialized = !1;
|
|
11
|
+
languageConfigs;
|
|
12
|
+
languageLoaded = {};
|
|
13
|
+
setNewLanguageCode;
|
|
14
|
+
constructor() {
|
|
15
|
+
super();
|
|
16
|
+
}
|
|
17
|
+
static getInstance() {
|
|
18
|
+
return s.__instance = i.getHmrSingleton("i18nService", s.__instance, () => new s()), s.__instance;
|
|
19
|
+
}
|
|
20
|
+
async init(e) {
|
|
21
|
+
if (this.setNewLanguageCode = e.setNewLanguageCode, this.getCurrentLanguageCode = e.getCurrentLanguageCode, this.languageConfigs = e.languageConfigs, this.isInitialized) {
|
|
22
|
+
console.warn("I18nService is already initialized");
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
let t = await this.getCurrentLanguageCode(), n = this.languageConfigs.find((e) => e.code === t);
|
|
26
|
+
await r(o).init({
|
|
27
|
+
fallbackLng: n.code,
|
|
28
|
+
interpolation: { escapeValue: !1 },
|
|
29
|
+
lng: n.code,
|
|
30
|
+
missingInterpolationHandler: (e, t, n) => {
|
|
31
|
+
console.warn(`Missing interpolation for key: "${e}" with value: "${JSON.stringify(t)}" and options: "${JSON.stringify(n)}"`);
|
|
32
|
+
},
|
|
33
|
+
missingKeyHandler: (e, t, n) => {
|
|
34
|
+
console.warn(`Missing translation for key: "${n}" in language: "${e.join(", ")}" and namespace: "${t}"`);
|
|
35
|
+
}
|
|
36
|
+
}), await this.loadResources(n.code), this.updateLangAttribute(n.code), this.isInitialized = !0;
|
|
37
|
+
}
|
|
38
|
+
async switchLanguage(e) {
|
|
39
|
+
await this.switchLanguageConfig(e), await this.loadResources(e), await n(e);
|
|
40
|
+
}
|
|
41
|
+
async switchLanguageConfig(e) {
|
|
42
|
+
await this.setNewLanguageCode(e), this.updateLangAttribute(e);
|
|
43
|
+
}
|
|
44
|
+
async loadResources(e) {
|
|
45
|
+
if (this.languageLoaded[e]) return;
|
|
46
|
+
let n = this.languageConfigs.find((t) => t.code === e);
|
|
47
|
+
if (!n) throw Error(`No i18n config found for code: ${e}`);
|
|
48
|
+
await Promise.all(n.bundles.map(async (e) => {
|
|
49
|
+
let r = await fetch(e);
|
|
50
|
+
if (!r.ok) throw Error(`Failed to load i18n bundle: ${e}`);
|
|
51
|
+
let i = await r.json();
|
|
52
|
+
t.addResourceBundle(n.code, "translation", i.translation, !0, !1);
|
|
53
|
+
})), this.languageLoaded[e] = !0;
|
|
54
|
+
}
|
|
55
|
+
updateLangAttribute(t) {
|
|
56
|
+
let n = e.getInstance().document;
|
|
57
|
+
if (!n) {
|
|
58
|
+
console.warn("Document is not available, cannot set lang attribute");
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
n.documentElement.setAttribute("lang", t);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
//#endregion
|
|
65
|
+
export { s as I18nService };
|
|
66
|
+
|
|
67
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/classes/services/I18nService/I18nService.ts"],"sourcesContent":["import i18next, {\n changeLanguage,\n use,\n} from 'i18next';\nimport { initReactI18next } from 'react-i18next';\nimport { EventBusAbstract } from '@gen-epix/ui-core/classes/abstracts/EventBusAbstract';\nimport { HmrUtil } from '@gen-epix/ui-core/utils/HmrUtil';\nimport { WindowService } from '@gen-epix/ui-core/classes/services/WindowService';\n\nexport type LanguageConfig = {\n bundles: string[];\n code: string;\n};\n\ntype Bundle = {\n translation: Record<string, string>;\n};\n\ntype I18nEvent = {\n onUserLanguageChange: string;\n};\n\nexport class I18nService extends EventBusAbstract<I18nEvent> {\n private static __instance: I18nService;\n\n private getCurrentLanguageCode: () => Promise<string> | string;\n private isInitialized = false;\n private languageConfigs: LanguageConfig[];\n private languageLoaded: Record<string, boolean> = {};\n private setNewLanguageCode: (code: string) => Promise<void> | void;\n private constructor() {\n super();\n }\n\n public static getInstance(): I18nService {\n I18nService.__instance = HmrUtil.getHmrSingleton('i18nService', I18nService.__instance, () => new I18nService());\n return I18nService.__instance;\n }\n\n public async init(kwArgs: {\n getCurrentLanguageCode: () => Promise<string> | string;\n languageConfigs: LanguageConfig[];\n setNewLanguageCode: (code: string) => Promise<void> | void;\n }): Promise<void> {\n this.setNewLanguageCode = kwArgs.setNewLanguageCode;\n this.getCurrentLanguageCode = kwArgs.getCurrentLanguageCode;\n this.languageConfigs = kwArgs.languageConfigs;\n if (this.isInitialized) {\n console.warn('I18nService is already initialized');\n return;\n }\n const currentLanguageCode = await this.getCurrentLanguageCode();\n const defaultLanguageConfig = this.languageConfigs.find(x => x.code === currentLanguageCode);\n\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n await use(initReactI18next)\n .init({\n fallbackLng: defaultLanguageConfig.code,\n interpolation: {\n escapeValue: false, // react already safes from xss => https://www.i18next.com/translation-function/interpolation#unescape\n },\n lng: defaultLanguageConfig.code,\n missingInterpolationHandler: (text, value, options) => {\n console.warn(`Missing interpolation for key: \"${text}\" with value: \"${JSON.stringify(value)}\" and options: \"${JSON.stringify(options)}\"`);\n },\n missingKeyHandler: (lng, ns, key) => {\n console.warn(`Missing translation for key: \"${key}\" in language: \"${lng.join(', ')}\" and namespace: \"${ns}\"`);\n },\n });\n\n await this.loadResources(defaultLanguageConfig.code);\n this.updateLangAttribute(defaultLanguageConfig.code);\n this.isInitialized = true;\n }\n\n public async switchLanguage(code: string): Promise<void> {\n await this.switchLanguageConfig(code);\n\n await this.loadResources(code);\n await changeLanguage(code);\n }\n\n public async switchLanguageConfig(code: string): Promise<void> {\n await this.setNewLanguageCode(code);\n this.updateLangAttribute(code);\n }\n\n private async loadResources(code: string): Promise<void> {\n if (this.languageLoaded[code]) {\n return;\n }\n const config = this.languageConfigs.find(x => x.code === code);\n if (!config) {\n throw new Error(`No i18n config found for code: ${code}`);\n }\n await Promise.all(config.bundles.map(async (bundleUrl) => {\n const response = await fetch(bundleUrl);\n if (!response.ok) {\n throw new Error(`Failed to load i18n bundle: ${bundleUrl}`);\n }\n const json = await response.json() as Bundle;\n i18next.addResourceBundle(\n config.code,\n 'translation',\n json.translation,\n true,\n false,\n );\n }));\n this.languageLoaded[code] = true;\n }\n\n private updateLangAttribute(code: string): void {\n const doc = WindowService.getInstance().document;\n if (!doc) {\n console.warn('Document is not available, cannot set lang attribute');\n return;\n }\n doc.documentElement.setAttribute('lang', code);\n }\n}\n"],"mappings":";;;;;;AAsBA,IAAa,IAAb,MAAa,UAAoB,EAA4B;CAC3D,OAAe;CAEf;CACA,gBAAwB;CACxB;CACA,iBAAkD,CAAC;CACnD;CACA,cAAsB;EACpB,MAAM;CACR;CAEA,OAAc,cAA2B;EAEvC,OADA,EAAY,aAAa,EAAQ,gBAAgB,eAAe,EAAY,kBAAkB,IAAI,EAAY,CAAC,GACxG,EAAY;CACrB;CAEA,MAAa,KAAK,GAIA;EAIhB,IAHA,KAAK,qBAAqB,EAAO,oBACjC,KAAK,yBAAyB,EAAO,wBACrC,KAAK,kBAAkB,EAAO,iBAC1B,KAAK,eAAe;GACtB,QAAQ,KAAK,oCAAoC;GACjD;EACF;EACA,IAAM,IAAsB,MAAM,KAAK,uBAAuB,GACxD,IAAwB,KAAK,gBAAgB,MAAK,MAAK,EAAE,SAAS,CAAmB;EAqB3F,AAjBA,MAAM,EAAI,CAAgB,CAAC,CACxB,KAAK;GACJ,aAAa,EAAsB;GACnC,eAAe,EACb,aAAa,GACf;GACA,KAAK,EAAsB;GAC3B,8BAA8B,GAAM,GAAO,MAAY;IACrD,QAAQ,KAAK,mCAAmC,EAAK,iBAAiB,KAAK,UAAU,CAAK,EAAE,kBAAkB,KAAK,UAAU,CAAO,EAAE,EAAE;GAC1I;GACA,oBAAoB,GAAK,GAAI,MAAQ;IACnC,QAAQ,KAAK,iCAAiC,EAAI,kBAAkB,EAAI,KAAK,IAAI,EAAE,oBAAoB,EAAG,EAAE;GAC9G;EACF,CAAC,GAEH,MAAM,KAAK,cAAc,EAAsB,IAAI,GACnD,KAAK,oBAAoB,EAAsB,IAAI,GACnD,KAAK,gBAAgB;CACvB;CAEA,MAAa,eAAe,GAA6B;EAIvD,AAHA,MAAM,KAAK,qBAAqB,CAAI,GAEpC,MAAM,KAAK,cAAc,CAAI,GAC7B,MAAM,EAAe,CAAI;CAC3B;CAEA,MAAa,qBAAqB,GAA6B;EAE7D,AADA,MAAM,KAAK,mBAAmB,CAAI,GAClC,KAAK,oBAAoB,CAAI;CAC/B;CAEA,MAAc,cAAc,GAA6B;EACvD,IAAI,KAAK,eAAe,IACtB;EAEF,IAAM,IAAS,KAAK,gBAAgB,MAAK,MAAK,EAAE,SAAS,CAAI;EAC7D,IAAI,CAAC,GACH,MAAU,MAAM,kCAAkC,GAAM;EAgB1D,AAdA,MAAM,QAAQ,IAAI,EAAO,QAAQ,IAAI,OAAO,MAAc;GACxD,IAAM,IAAW,MAAM,MAAM,CAAS;GACtC,IAAI,CAAC,EAAS,IACZ,MAAU,MAAM,+BAA+B,GAAW;GAE5D,IAAM,IAAO,MAAM,EAAS,KAAK;GACjC,EAAQ,kBACN,EAAO,MACP,eACA,EAAK,aACL,IACA,EACF;EACF,CAAC,CAAC,GACF,KAAK,eAAe,KAAQ;CAC9B;CAEA,oBAA4B,GAAoB;EAC9C,IAAM,IAAM,EAAc,YAAY,CAAC,CAAC;EACxC,IAAI,CAAC,GAAK;GACR,QAAQ,KAAK,sDAAsD;GACnE;EACF;EACA,EAAI,gBAAgB,aAAa,QAAQ,CAAI;CAC/C;AACF"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SubscribableAbstract } from '@gen-epix/ui-core/classes/abstracts/SubscribableAbstract';
|
|
2
|
+
export type InactivityState = {
|
|
3
|
+
idleDiff: number;
|
|
4
|
+
isIdle: boolean;
|
|
5
|
+
notificationDiff: number;
|
|
6
|
+
readableIdleDiff: string;
|
|
7
|
+
readableNotificationDiff: string;
|
|
8
|
+
};
|
|
9
|
+
export declare class InactivityService extends SubscribableAbstract<InactivityState> {
|
|
10
|
+
private static __instance;
|
|
11
|
+
private idleDiff;
|
|
12
|
+
private idleSince;
|
|
13
|
+
private isIdle;
|
|
14
|
+
private isPaused;
|
|
15
|
+
private notificationDiff;
|
|
16
|
+
private readonly onActivityDebounced;
|
|
17
|
+
private constructor();
|
|
18
|
+
static getInstance(): InactivityService;
|
|
19
|
+
logout(): void;
|
|
20
|
+
pause(): void;
|
|
21
|
+
reset(): void;
|
|
22
|
+
resume(): void;
|
|
23
|
+
private doNext;
|
|
24
|
+
private onActivity;
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './InactivityService';
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { n as e, t } from "../../../_chunks/rolldown-runtime.js";
|
|
2
|
+
import { TimeUtil as n } from "../../../utils/TimeUtil/index.js";
|
|
3
|
+
import { i as r } from "../../../_chunks/isObjectLike.js";
|
|
4
|
+
import { t as i } from "../../../_chunks/isSymbol.js";
|
|
5
|
+
import { t as a } from "../../../_chunks/isObject.js";
|
|
6
|
+
import { ConfigService as o } from "../ConfigService/index.js";
|
|
7
|
+
import { AuthenticationService as s } from "../AuthenticationService/index.js";
|
|
8
|
+
import { LogService as c } from "../LogService/index.js";
|
|
9
|
+
import { CommonDbLogLevel as l } from "@gen-epix/api-commondb";
|
|
10
|
+
import { HmrUtil as u } from "@gen-epix/ui-core/utils/HmrUtil";
|
|
11
|
+
import { Subject as d } from "@gen-epix/ui-core/classes/Subject";
|
|
12
|
+
import { SubscribableAbstract as f } from "@gen-epix/ui-core/classes/abstracts/SubscribableAbstract";
|
|
13
|
+
//#region ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/now.js
|
|
14
|
+
var p = /* @__PURE__ */ t(((e, t) => {
|
|
15
|
+
var n = r();
|
|
16
|
+
t.exports = function() {
|
|
17
|
+
return n.Date.now();
|
|
18
|
+
};
|
|
19
|
+
})), m = /* @__PURE__ */ t(((e, t) => {
|
|
20
|
+
var n = /\s/;
|
|
21
|
+
function r(e) {
|
|
22
|
+
for (var t = e.length; t-- && n.test(e.charAt(t)););
|
|
23
|
+
return t;
|
|
24
|
+
}
|
|
25
|
+
t.exports = r;
|
|
26
|
+
})), h = /* @__PURE__ */ t(((e, t) => {
|
|
27
|
+
var n = m(), r = /^\s+/;
|
|
28
|
+
function i(e) {
|
|
29
|
+
return e && e.slice(0, n(e) + 1).replace(r, "");
|
|
30
|
+
}
|
|
31
|
+
t.exports = i;
|
|
32
|
+
})), g = /* @__PURE__ */ t(((e, t) => {
|
|
33
|
+
var n = h(), r = a(), o = i(), s = NaN, c = /^[-+]0x[0-9a-f]+$/i, l = /^0b[01]+$/i, u = /^0o[0-7]+$/i, d = parseInt;
|
|
34
|
+
function f(e) {
|
|
35
|
+
if (typeof e == "number") return e;
|
|
36
|
+
if (o(e)) return s;
|
|
37
|
+
if (r(e)) {
|
|
38
|
+
var t = typeof e.valueOf == "function" ? e.valueOf() : e;
|
|
39
|
+
e = r(t) ? t + "" : t;
|
|
40
|
+
}
|
|
41
|
+
if (typeof e != "string") return e === 0 ? e : +e;
|
|
42
|
+
e = n(e);
|
|
43
|
+
var i = l.test(e);
|
|
44
|
+
return i || u.test(e) ? d(e.slice(2), i ? 2 : 8) : c.test(e) ? s : +e;
|
|
45
|
+
}
|
|
46
|
+
t.exports = f;
|
|
47
|
+
})), _ = /* @__PURE__ */ t(((e, t) => {
|
|
48
|
+
var n = a(), r = p(), i = g(), o = "Expected a function", s = Math.max, c = Math.min;
|
|
49
|
+
function l(e, t, a) {
|
|
50
|
+
var l, u, d, f, p, m, h = 0, g = !1, _ = !1, v = !0;
|
|
51
|
+
if (typeof e != "function") throw TypeError(o);
|
|
52
|
+
t = i(t) || 0, n(a) && (g = !!a.leading, _ = "maxWait" in a, d = _ ? s(i(a.maxWait) || 0, t) : d, v = "trailing" in a ? !!a.trailing : v);
|
|
53
|
+
function y(t) {
|
|
54
|
+
var n = l, r = u;
|
|
55
|
+
return l = u = void 0, h = t, f = e.apply(r, n), f;
|
|
56
|
+
}
|
|
57
|
+
function b(e) {
|
|
58
|
+
return h = e, p = setTimeout(C, t), g ? y(e) : f;
|
|
59
|
+
}
|
|
60
|
+
function x(e) {
|
|
61
|
+
var n = e - m, r = e - h, i = t - n;
|
|
62
|
+
return _ ? c(i, d - r) : i;
|
|
63
|
+
}
|
|
64
|
+
function S(e) {
|
|
65
|
+
var n = e - m, r = e - h;
|
|
66
|
+
return m === void 0 || n >= t || n < 0 || _ && r >= d;
|
|
67
|
+
}
|
|
68
|
+
function C() {
|
|
69
|
+
var e = r();
|
|
70
|
+
if (S(e)) return w(e);
|
|
71
|
+
p = setTimeout(C, x(e));
|
|
72
|
+
}
|
|
73
|
+
function w(e) {
|
|
74
|
+
return p = void 0, v && l ? y(e) : (l = u = void 0, f);
|
|
75
|
+
}
|
|
76
|
+
function T() {
|
|
77
|
+
p !== void 0 && clearTimeout(p), h = 0, l = m = u = p = void 0;
|
|
78
|
+
}
|
|
79
|
+
function E() {
|
|
80
|
+
return p === void 0 ? f : w(r());
|
|
81
|
+
}
|
|
82
|
+
function D() {
|
|
83
|
+
var e = r(), n = S(e);
|
|
84
|
+
if (l = arguments, u = this, m = e, n) {
|
|
85
|
+
if (p === void 0) return b(m);
|
|
86
|
+
if (_) return clearTimeout(p), p = setTimeout(C, t), y(m);
|
|
87
|
+
}
|
|
88
|
+
return p === void 0 && (p = setTimeout(C, t)), f;
|
|
89
|
+
}
|
|
90
|
+
return D.cancel = T, D.flush = E, D;
|
|
91
|
+
}
|
|
92
|
+
t.exports = l;
|
|
93
|
+
})), v = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
94
|
+
var n = _(), r = a(), i = "Expected a function";
|
|
95
|
+
function o(e, t, a) {
|
|
96
|
+
var o = !0, s = !0;
|
|
97
|
+
if (typeof e != "function") throw TypeError(i);
|
|
98
|
+
return r(a) && (o = "leading" in a ? !!a.leading : o, s = "trailing" in a ? !!a.trailing : s), n(e, t, {
|
|
99
|
+
leading: o,
|
|
100
|
+
maxWait: t,
|
|
101
|
+
trailing: s
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
t.exports = o;
|
|
105
|
+
})))(), 1), y = class e extends f {
|
|
106
|
+
static __instance;
|
|
107
|
+
idleDiff = 0;
|
|
108
|
+
idleSince = Date.now();
|
|
109
|
+
isIdle = !1;
|
|
110
|
+
isPaused = !1;
|
|
111
|
+
notificationDiff = 0;
|
|
112
|
+
onActivityDebounced;
|
|
113
|
+
constructor() {
|
|
114
|
+
super(new d({
|
|
115
|
+
idleDiff: 0,
|
|
116
|
+
isIdle: !1,
|
|
117
|
+
notificationDiff: 0,
|
|
118
|
+
readableIdleDiff: "",
|
|
119
|
+
readableNotificationDiff: ""
|
|
120
|
+
}));
|
|
121
|
+
let e = o.getInstance().config.userInactivityConfirmation.ALLOWED_IDLE_TIME_MS, t = o.getInstance().config.userInactivityConfirmation.NOTIFICATION_TIME_MS;
|
|
122
|
+
this.onActivityDebounced = (0, v.default)(this.onActivity.bind(this), 1e3, {
|
|
123
|
+
leading: !0,
|
|
124
|
+
trailing: !0
|
|
125
|
+
}), [
|
|
126
|
+
"mousemove",
|
|
127
|
+
"keydown",
|
|
128
|
+
"scroll"
|
|
129
|
+
].forEach((e) => window.addEventListener(e, this.onActivityDebounced)), setInterval(() => {
|
|
130
|
+
if (this.idleSince > 0 && Date.now() - e > this.idleSince && !this.isPaused) {
|
|
131
|
+
this.idleDiff = Date.now() - this.idleSince, this.isIdle = !0;
|
|
132
|
+
let n = this.idleSince + e + t;
|
|
133
|
+
this.notificationDiff = n - Date.now(), this.notificationDiff < 0 && this.logout(), this.isIdle && this.doNext();
|
|
134
|
+
}
|
|
135
|
+
}, 500);
|
|
136
|
+
}
|
|
137
|
+
static getInstance() {
|
|
138
|
+
return e.__instance = u.getHmrSingleton("inactivityService", e.__instance, () => new e()), e.__instance;
|
|
139
|
+
}
|
|
140
|
+
logout() {
|
|
141
|
+
c.getInstance().log([{
|
|
142
|
+
detail: s.getInstance().authContextProps.user,
|
|
143
|
+
level: l.TRACE,
|
|
144
|
+
topic: "USER_LOGOUT_BY_INACTIVITY"
|
|
145
|
+
}]), c.getInstance().flushLog(), s.getInstance().authContextProps.signoutRedirect();
|
|
146
|
+
}
|
|
147
|
+
pause() {
|
|
148
|
+
this.isPaused = !0, this.reset();
|
|
149
|
+
}
|
|
150
|
+
reset() {
|
|
151
|
+
this.idleSince = Date.now(), this.isIdle = !1, this.idleDiff = 0, this.notificationDiff = 0, this.doNext();
|
|
152
|
+
}
|
|
153
|
+
resume() {
|
|
154
|
+
this.isPaused = !1, this.reset();
|
|
155
|
+
}
|
|
156
|
+
doNext() {
|
|
157
|
+
this.next({
|
|
158
|
+
idleDiff: this.idleDiff,
|
|
159
|
+
isIdle: this.isIdle,
|
|
160
|
+
notificationDiff: this.notificationDiff,
|
|
161
|
+
readableIdleDiff: n.getReadableTimeRemaining(this.idleDiff),
|
|
162
|
+
readableNotificationDiff: n.getReadableTimeRemaining(this.notificationDiff)
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
onActivity() {
|
|
166
|
+
this.isIdle || (this.idleSince = Date.now());
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
//#endregion
|
|
170
|
+
export { y as InactivityService };
|
|
171
|
+
|
|
172
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/now.js","../../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_trimmedEndIndex.js","../../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseTrim.js","../../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/toNumber.js","../../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/debounce.js","../../../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/throttle.js","../../../../src/classes/services/InactivityService/InactivityService.ts"],"sourcesContent":["var root = require('./_root');\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\nmodule.exports = now;\n","/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\nfunction trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n}\n\nmodule.exports = trimmedEndIndex;\n","var trimmedEndIndex = require('./_trimmedEndIndex');\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n}\n\nmodule.exports = baseTrim;\n","var baseTrim = require('./_baseTrim'),\n isObject = require('./isObject'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = toNumber;\n","var isObject = require('./isObject'),\n now = require('./now'),\n toNumber = require('./toNumber');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\nmodule.exports = debounce;\n","var debounce = require('./debounce'),\n isObject = require('./isObject');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\nfunction throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n}\n\nmodule.exports = throttle;\n","import throttle from 'lodash/throttle';\nimport { CommonDbLogLevel } from '@gen-epix/api-commondb';\nimport { SubscribableAbstract } from '@gen-epix/ui-core/classes/abstracts/SubscribableAbstract';\nimport { Subject } from '@gen-epix/ui-core/classes/Subject';\nimport { HmrUtil } from '@gen-epix/ui-core/utils/HmrUtil';\n\nimport { AuthenticationService } from '../AuthenticationService';\nimport { ConfigService } from '../ConfigService';\nimport { LogService } from '../LogService';\nimport { TimeUtil } from '../../../utils/TimeUtil';\n\nexport type InactivityState = {\n idleDiff: number;\n isIdle: boolean;\n notificationDiff: number;\n readableIdleDiff: string;\n readableNotificationDiff: string;\n};\n\nexport class InactivityService extends SubscribableAbstract<InactivityState> {\n private static __instance: InactivityService;\n\n private idleDiff: number = 0;\n\n private idleSince: number = Date.now();\n private isIdle: boolean = false;\n private isPaused: boolean = false;\n private notificationDiff: number = 0;\n private readonly onActivityDebounced: () => void;\n\n private constructor() {\n super(new Subject<InactivityState>({\n idleDiff: 0,\n isIdle: false,\n notificationDiff: 0,\n readableIdleDiff: '',\n readableNotificationDiff: '',\n }));\n\n const ALLOWED_IDLE_TIME_MS = ConfigService.getInstance().config.userInactivityConfirmation.ALLOWED_IDLE_TIME_MS;\n const NOTIFICATION_TIME_MS = ConfigService.getInstance().config.userInactivityConfirmation.NOTIFICATION_TIME_MS;\n\n this.onActivityDebounced = throttle(this.onActivity.bind(this), 1000, {\n leading: true,\n trailing: true,\n });\n\n ['mousemove', 'keydown', 'scroll'].forEach((event) => window.addEventListener(event, this.onActivityDebounced));\n\n setInterval(() => {\n if (this.idleSince > 0 && (Date.now() - ALLOWED_IDLE_TIME_MS) > this.idleSince && !this.isPaused) {\n this.idleDiff = Date.now() - this.idleSince;\n this.isIdle = true;\n\n const notificationEndTime = this.idleSince + ALLOWED_IDLE_TIME_MS + NOTIFICATION_TIME_MS;\n this.notificationDiff = notificationEndTime - Date.now();\n\n if (this.notificationDiff < 0) {\n this.logout();\n }\n\n if (this.isIdle) {\n this.doNext();\n }\n }\n }, 500);\n }\n\n public static getInstance(): InactivityService {\n InactivityService.__instance = HmrUtil.getHmrSingleton('inactivityService', InactivityService.__instance, () => new InactivityService());\n return InactivityService.__instance;\n }\n\n public logout(): void {\n LogService.getInstance().log([{\n detail: AuthenticationService.getInstance().authContextProps.user,\n level: CommonDbLogLevel.TRACE,\n topic: 'USER_LOGOUT_BY_INACTIVITY',\n }]);\n LogService.getInstance().flushLog();\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n AuthenticationService.getInstance().authContextProps.signoutRedirect();\n }\n\n public pause(): void {\n this.isPaused = true;\n this.reset();\n }\n\n public reset(): void {\n this.idleSince = Date.now();\n this.isIdle = false;\n this.idleDiff = 0;\n this.notificationDiff = 0;\n this.doNext();\n }\n\n public resume(): void {\n this.isPaused = false;\n this.reset();\n }\n\n private doNext(): void {\n this.next({\n idleDiff: this.idleDiff,\n isIdle: this.isIdle,\n notificationDiff: this.notificationDiff,\n readableIdleDiff: TimeUtil.getReadableTimeRemaining(this.idleDiff),\n readableNotificationDiff: TimeUtil.getReadableTimeRemaining(this.notificationDiff),\n });\n }\n\n private onActivity(): void {\n if (this.isIdle) {\n return;\n }\n this.idleSince = Date.now();\n }\n\n}\n"],"x_google_ignoreList":[0,1,2,3,4,5],"mappings":";;;;;;;;;;;;;;CAAA,IAAI,IAAA,EAAA;CAsBJ,EAAO,UAAU,WAJI;EACnB,OAAO,EAAK,KAAK,IAAI;CACvB;;CCnBA,IAAI,IAAe;CAUnB,SAAS,EAAgB,GAAQ;EAG/B,KAFA,IAAI,IAAQ,EAAO,QAEZ,OAAW,EAAa,KAAK,EAAO,OAAO,CAAK,CAAC;EACxD,OAAO;CACT;CAEA,EAAO,UAAU;;CClBjB,IAAI,IAAA,EAAA,GAGA,IAAc;CASlB,SAAS,EAAS,GAAQ;EACxB,OAAO,KACH,EAAO,MAAM,GAAG,EAAgB,CAAM,IAAI,CAAC,CAAC,CAAC,QAAQ,GAAa,EAAE;CAE1E;CAEA,EAAO,UAAU;;CClBjB,IAAI,IAAA,EAAA,GACA,IAAA,EAAA,GACA,IAAA,EAAA,GAGA,IAAM,KAGN,IAAa,sBAGb,IAAa,cAGb,IAAY,eAGZ,IAAe;CAyBnB,SAAS,EAAS,GAAO;EACvB,IAAI,OAAO,KAAS,UAClB,OAAO;EAET,IAAI,EAAS,CAAK,GAChB,OAAO;EAET,IAAI,EAAS,CAAK,GAAG;GACnB,IAAI,IAAQ,OAAO,EAAM,WAAW,aAAa,EAAM,QAAQ,IAAI;GACnE,IAAQ,EAAS,CAAK,IAAK,IAAQ,KAAM;EAC3C;EACA,IAAI,OAAO,KAAS,UAClB,OAAO,MAAU,IAAI,IAAQ,CAAC;EAEhC,IAAQ,EAAS,CAAK;EACtB,IAAI,IAAW,EAAW,KAAK,CAAK;EACpC,OAAQ,KAAY,EAAU,KAAK,CAAK,IACpC,EAAa,EAAM,MAAM,CAAC,GAAG,IAAW,IAAI,CAAC,IAC5C,EAAW,KAAK,CAAK,IAAI,IAAM,CAAC;CACvC;CAEA,EAAO,UAAU;;CC/DjB,IAAI,IAAA,EAAA,GACA,IAAA,EAAA,GACA,IAAA,EAAA,GAGA,IAAkB,uBAGlB,IAAY,KAAK,KACjB,IAAY,KAAK;CAwDrB,SAAS,EAAS,GAAM,GAAM,GAAS;EACrC,IAAI,GACA,GACA,GACA,GACA,GACA,GACA,IAAiB,GACjB,IAAU,IACV,IAAS,IACT,IAAW;EAEf,IAAI,OAAO,KAAQ,YACjB,MAAU,UAAU,CAAe;EAGrC,AADA,IAAO,EAAS,CAAI,KAAK,GACrB,EAAS,CAAO,MAClB,IAAU,CAAC,CAAC,EAAQ,SACpB,IAAS,aAAa,GACtB,IAAU,IAAS,EAAU,EAAS,EAAQ,OAAO,KAAK,GAAG,CAAI,IAAI,GACrE,IAAW,cAAc,IAAU,CAAC,CAAC,EAAQ,WAAW;EAG1D,SAAS,EAAW,GAAM;GACxB,IAAI,IAAO,GACP,IAAU;GAKd,OAHA,IAAW,IAAW,KAAA,GACtB,IAAiB,GACjB,IAAS,EAAK,MAAM,GAAS,CAAI,GAC1B;EACT;EAEA,SAAS,EAAY,GAAM;GAMzB,OAJA,IAAiB,GAEjB,IAAU,WAAW,GAAc,CAAI,GAEhC,IAAU,EAAW,CAAI,IAAI;EACtC;EAEA,SAAS,EAAc,GAAM;GAC3B,IAAI,IAAoB,IAAO,GAC3B,IAAsB,IAAO,GAC7B,IAAc,IAAO;GAEzB,OAAO,IACH,EAAU,GAAa,IAAU,CAAmB,IACpD;EACN;EAEA,SAAS,EAAa,GAAM;GAC1B,IAAI,IAAoB,IAAO,GAC3B,IAAsB,IAAO;GAKjC,OAAQ,MAAiB,KAAA,KAAc,KAAqB,KACzD,IAAoB,KAAO,KAAU,KAAuB;EACjE;EAEA,SAAS,IAAe;GACtB,IAAI,IAAO,EAAI;GACf,IAAI,EAAa,CAAI,GACnB,OAAO,EAAa,CAAI;GAG1B,IAAU,WAAW,GAAc,EAAc,CAAI,CAAC;EACxD;EAEA,SAAS,EAAa,GAAM;GAS1B,OARA,IAAU,KAAA,GAIN,KAAY,IACP,EAAW,CAAI,KAExB,IAAW,IAAW,KAAA,GACf;EACT;EAEA,SAAS,IAAS;GAKhB,AAJI,MAAY,KAAA,KACd,aAAa,CAAO,GAEtB,IAAiB,GACjB,IAAW,IAAe,IAAW,IAAU,KAAA;EACjD;EAEA,SAAS,IAAQ;GACf,OAAO,MAAY,KAAA,IAAY,IAAS,EAAa,EAAI,CAAC;EAC5D;EAEA,SAAS,IAAY;GACnB,IAAI,IAAO,EAAI,GACX,IAAa,EAAa,CAAI;GAMlC,IAJA,IAAW,WACX,IAAW,MACX,IAAe,GAEX,GAAY;IACd,IAAI,MAAY,KAAA,GACd,OAAO,EAAY,CAAY;IAEjC,IAAI,GAIF,OAFA,aAAa,CAAO,GACpB,IAAU,WAAW,GAAc,CAAI,GAChC,EAAW,CAAY;GAElC;GAIA,OAHI,MAAY,KAAA,MACd,IAAU,WAAW,GAAc,CAAI,IAElC;EACT;EAGA,OAFA,EAAU,SAAS,GACnB,EAAU,QAAQ,GACX;CACT;CAEA,EAAO,UAAU;;CC9LjB,IAAI,IAAA,EAAA,GACA,IAAA,EAAA,GAGA,IAAkB;CA8CtB,SAAS,EAAS,GAAM,GAAM,GAAS;EACrC,IAAI,IAAU,IACV,IAAW;EAEf,IAAI,OAAO,KAAQ,YACjB,MAAU,UAAU,CAAe;EAMrC,OAJI,EAAS,CAAO,MAClB,IAAU,aAAa,IAAU,CAAC,CAAC,EAAQ,UAAU,GACrD,IAAW,cAAc,IAAU,CAAC,CAAC,EAAQ,WAAW,IAEnD,EAAS,GAAM,GAAM;GAC1B,SAAW;GACX,SAAW;GACX,UAAY;EACd,CAAC;CACH;CAEA,EAAO,UAAU;YCjDJ,IAAb,MAAa,UAA0B,EAAsC;CAC3E,OAAe;CAEf,WAA2B;CAE3B,YAA4B,KAAK,IAAI;CACrC,SAA0B;CAC1B,WAA4B;CAC5B,mBAAmC;CACnC;CAEA,cAAsB;EACpB,MAAM,IAAI,EAAyB;GACjC,UAAU;GACV,QAAQ;GACR,kBAAkB;GAClB,kBAAkB;GAClB,0BAA0B;EAC5B,CAAC,CAAC;EAEF,IAAM,IAAuB,EAAc,YAAY,CAAC,CAAC,OAAO,2BAA2B,sBACrF,IAAuB,EAAc,YAAY,CAAC,CAAC,OAAO,2BAA2B;EAS3F,AAPA,KAAK,uBAAA,GAAA,EAAA,QAAA,CAA+B,KAAK,WAAW,KAAK,IAAI,GAAG,KAAM;GACpE,SAAS;GACT,UAAU;EACZ,CAAC,GAED;GAAC;GAAa;GAAW;EAAQ,CAAC,CAAC,SAAS,MAAU,OAAO,iBAAiB,GAAO,KAAK,mBAAmB,CAAC,GAE9G,kBAAkB;GAChB,IAAI,KAAK,YAAY,KAAM,KAAK,IAAI,IAAI,IAAwB,KAAK,aAAa,CAAC,KAAK,UAAU;IAEhG,AADA,KAAK,WAAW,KAAK,IAAI,IAAI,KAAK,WAClC,KAAK,SAAS;IAEd,IAAM,IAAsB,KAAK,YAAY,IAAuB;IAOpE,AANA,KAAK,mBAAmB,IAAsB,KAAK,IAAI,GAEnD,KAAK,mBAAmB,KAC1B,KAAK,OAAO,GAGV,KAAK,UACP,KAAK,OAAO;GAEhB;EACF,GAAG,GAAG;CACR;CAEA,OAAc,cAAiC;EAE7C,OADA,EAAkB,aAAa,EAAQ,gBAAgB,qBAAqB,EAAkB,kBAAkB,IAAI,EAAkB,CAAC,GAChI,EAAkB;CAC3B;CAEA,SAAsB;EAQpB,AAPA,EAAW,YAAY,CAAC,CAAC,IAAI,CAAC;GAC5B,QAAQ,EAAsB,YAAY,CAAC,CAAC,iBAAiB;GAC7D,OAAO,EAAiB;GACxB,OAAO;EACT,CAAC,CAAC,GACF,EAAW,YAAY,CAAC,CAAC,SAAS,GAElC,EAAsB,YAAY,CAAC,CAAC,iBAAiB,gBAAgB;CACvE;CAEA,QAAqB;EAEnB,AADA,KAAK,WAAW,IAChB,KAAK,MAAM;CACb;CAEA,QAAqB;EAKnB,AAJA,KAAK,YAAY,KAAK,IAAI,GAC1B,KAAK,SAAS,IACd,KAAK,WAAW,GAChB,KAAK,mBAAmB,GACxB,KAAK,OAAO;CACd;CAEA,SAAsB;EAEpB,AADA,KAAK,WAAW,IAChB,KAAK,MAAM;CACb;CAEA,SAAuB;EACrB,KAAK,KAAK;GACR,UAAU,KAAK;GACf,QAAQ,KAAK;GACb,kBAAkB,KAAK;GACvB,kBAAkB,EAAS,yBAAyB,KAAK,QAAQ;GACjE,0BAA0B,EAAS,yBAAyB,KAAK,gBAAgB;EACnF,CAAC;CACH;CAEA,aAA2B;EACrB,KAAK,WAGT,KAAK,YAAY,KAAK,IAAI;CAC5B;AAEF"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { AxiosResponse, InternalAxiosRequestConfig } from 'axios';
|
|
2
|
+
import { CommonDbLogLevel } from '@gen-epix/api-commondb';
|
|
3
|
+
type LogServiceItem = {
|
|
4
|
+
detail?: unknown;
|
|
5
|
+
duration?: number;
|
|
6
|
+
level: CommonDbLogLevel;
|
|
7
|
+
topic: string;
|
|
8
|
+
};
|
|
9
|
+
export declare class LogService {
|
|
10
|
+
private static __instance;
|
|
11
|
+
protected readonly requestMap: Map<string, number>;
|
|
12
|
+
private logItems;
|
|
13
|
+
private constructor();
|
|
14
|
+
static getInstance(): LogService;
|
|
15
|
+
flushLog(): void;
|
|
16
|
+
log(items: LogServiceItem[]): void;
|
|
17
|
+
onRequest(request: InternalAxiosRequestConfig): InternalAxiosRequestConfig;
|
|
18
|
+
onResponseFulfilled(response: AxiosResponse): AxiosResponse;
|
|
19
|
+
onResponseRejected(error: unknown): void;
|
|
20
|
+
private sendLog;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './LogService';
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { ConfigService as e } from "../ConfigService/index.js";
|
|
2
|
+
import { AxiosUtil as t } from "../../../utils/AxiosUtil/index.js";
|
|
3
|
+
import { AuthenticationService as n } from "../AuthenticationService/index.js";
|
|
4
|
+
import { ApiService as r } from "../ApiService/index.js";
|
|
5
|
+
import { StringUtil as i } from "@gen-epix/ui-core/utils/StringUtil";
|
|
6
|
+
import { CommonDbLogLevel as a } from "@gen-epix/api-commondb";
|
|
7
|
+
import { HmrUtil as o } from "@gen-epix/ui-core/utils/HmrUtil";
|
|
8
|
+
import { isAxiosError as s } from "axios";
|
|
9
|
+
//#region src/classes/services/LogService/LogService.ts
|
|
10
|
+
var c = class c {
|
|
11
|
+
static __instance;
|
|
12
|
+
requestMap;
|
|
13
|
+
logItems = [];
|
|
14
|
+
constructor() {
|
|
15
|
+
this.requestMap = /* @__PURE__ */ new Map(), setInterval(() => {
|
|
16
|
+
this.sendLog();
|
|
17
|
+
}, e.getInstance().config.log.LOG_INTERVAL_MS);
|
|
18
|
+
}
|
|
19
|
+
static getInstance() {
|
|
20
|
+
return c.__instance = o.getHmrSingleton("logService", c.__instance, () => new c()), c.__instance;
|
|
21
|
+
}
|
|
22
|
+
flushLog() {
|
|
23
|
+
this.sendLog();
|
|
24
|
+
}
|
|
25
|
+
log(t) {
|
|
26
|
+
let n = (/* @__PURE__ */ new Date()).toISOString(), r = e.getInstance().config.getSoftwareVersion();
|
|
27
|
+
this.logItems.push(...t.map((e) => ({
|
|
28
|
+
command_id: i.createUuid(),
|
|
29
|
+
detail: e.detail ? JSON.stringify(e.detail) : null,
|
|
30
|
+
duration: e.duration ?? null,
|
|
31
|
+
level: e.level,
|
|
32
|
+
software_version: r,
|
|
33
|
+
timestamp: n,
|
|
34
|
+
topic: e.topic ?? null
|
|
35
|
+
})));
|
|
36
|
+
}
|
|
37
|
+
onRequest(e) {
|
|
38
|
+
if (e.headers.has("X-IGNORE-LOG")) return e;
|
|
39
|
+
let t = i.createUuid();
|
|
40
|
+
return e.headers.set("X-REQUEST-ID", t), this.requestMap.set(t, (/* @__PURE__ */ new Date()).getTime()), this.log([{
|
|
41
|
+
detail: {
|
|
42
|
+
requestData: e.data,
|
|
43
|
+
requestParams: e.params,
|
|
44
|
+
url: e.url
|
|
45
|
+
},
|
|
46
|
+
level: a.TRACE,
|
|
47
|
+
topic: "REQUEST"
|
|
48
|
+
}]), e;
|
|
49
|
+
}
|
|
50
|
+
onResponseFulfilled(e) {
|
|
51
|
+
if (e.config.headers.has("X-IGNORE-LOG")) return e;
|
|
52
|
+
let t = e?.config?.headers.get("X-REQUEST-ID"), n = (/* @__PURE__ */ new Date()).getTime() - this.requestMap.get(t);
|
|
53
|
+
return this.log([{
|
|
54
|
+
detail: {
|
|
55
|
+
requestData: e.config.data,
|
|
56
|
+
requestParams: e.config.params,
|
|
57
|
+
url: e.config.url
|
|
58
|
+
},
|
|
59
|
+
duration: n,
|
|
60
|
+
level: e.status >= 200 && e.status < 300 ? a.TRACE : a.ERROR,
|
|
61
|
+
topic: "RESPONSE"
|
|
62
|
+
}]), e;
|
|
63
|
+
}
|
|
64
|
+
onResponseRejected(e) {
|
|
65
|
+
if (s(e)) {
|
|
66
|
+
if (t.isAxiosCanceledError(e)) return;
|
|
67
|
+
let n = e?.config?.headers.get("X-REQUEST-ID"), r = (/* @__PURE__ */ new Date()).getTime() - this.requestMap.get(n);
|
|
68
|
+
this.log([{
|
|
69
|
+
detail: {
|
|
70
|
+
requestParams: e.config.params,
|
|
71
|
+
responseData: e.response.data,
|
|
72
|
+
status: e.response.status,
|
|
73
|
+
url: e.config.url
|
|
74
|
+
},
|
|
75
|
+
duration: r,
|
|
76
|
+
level: a.ERROR,
|
|
77
|
+
topic: "RESPONSE_ERROR"
|
|
78
|
+
}]);
|
|
79
|
+
} else this.log([{
|
|
80
|
+
detail: { error: e },
|
|
81
|
+
level: a.ERROR,
|
|
82
|
+
topic: "RESPONSE_ERROR"
|
|
83
|
+
}]);
|
|
84
|
+
}
|
|
85
|
+
sendLog() {
|
|
86
|
+
!this.logItems.length || !n.getInstance()?.authContextProps?.isAuthenticated || document.location.href.includes("accept-invitation") || (r.getInstance().systemApi.log({ log_items: this.logItems }, { headers: { "X-IGNORE-LOG": "1" } }).catch(() => 0), this.logItems = []);
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
//#endregion
|
|
90
|
+
export { c as LogService };
|
|
91
|
+
|
|
92
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/classes/services/LogService/LogService.ts"],"sourcesContent":["import { isAxiosError } from 'axios';\nimport type {\n AxiosResponse,\n InternalAxiosRequestConfig,\n} from 'axios';\nimport { CommonDbLogLevel } from '@gen-epix/api-commondb';\nimport type { CommonDbLogItem } from '@gen-epix/api-commondb';\nimport { HmrUtil } from '@gen-epix/ui-core/utils/HmrUtil';\nimport { StringUtil } from '@gen-epix/ui-core/utils/StringUtil';\n\nimport { AuthenticationService } from '../AuthenticationService';\nimport { ConfigService } from '../ConfigService';\nimport { ApiService } from '../ApiService';\nimport { AxiosUtil } from '../../../utils/AxiosUtil';\n\ntype LogServiceItem = {\n detail?: unknown;\n duration?: number;\n level: CommonDbLogLevel;\n topic: string;\n};\n\nexport class LogService {\n private static __instance: LogService;\n\n protected readonly requestMap: Map<string, number>;\n\n private logItems: CommonDbLogItem[] = [];\n\n private constructor() {\n this.requestMap = new Map<string, number>();\n setInterval(() => {\n this.sendLog();\n }, ConfigService.getInstance().config.log.LOG_INTERVAL_MS);\n }\n\n public static getInstance(): LogService {\n LogService.__instance = HmrUtil.getHmrSingleton('logService', LogService.__instance, () => new LogService());\n return LogService.__instance;\n }\n\n public flushLog(): void {\n this.sendLog();\n }\n\n public log(items: LogServiceItem[]): void {\n const timestamp = new Date().toISOString();\n const software_version = ConfigService.getInstance().config.getSoftwareVersion();\n this.logItems.push(...items.map<CommonDbLogItem>(item => {\n return {\n command_id: StringUtil.createUuid(),\n detail: item.detail ? JSON.stringify(item.detail) : null,\n duration: item.duration ?? null,\n level: item.level,\n software_version,\n timestamp,\n topic: item.topic ?? null,\n };\n }));\n }\n\n public onRequest(request: InternalAxiosRequestConfig): InternalAxiosRequestConfig {\n if (request.headers.has('X-IGNORE-LOG')) {\n return request;\n }\n const requestId = StringUtil.createUuid();\n request.headers.set('X-REQUEST-ID', requestId);\n this.requestMap.set(requestId, new Date().getTime());\n\n this.log([{\n detail: {\n requestData: request.data as unknown,\n requestParams: request.params as unknown,\n url: request.url,\n },\n level: CommonDbLogLevel.TRACE,\n topic: 'REQUEST',\n }]);\n\n return request;\n }\n\n public onResponseFulfilled(response: AxiosResponse): AxiosResponse {\n if (response.config.headers.has('X-IGNORE-LOG')) {\n return response;\n }\n\n const requestId = response?.config?.headers.get('X-REQUEST-ID') as string;\n const duration = new Date().getTime() - this.requestMap.get(requestId);\n\n this.log([{\n detail: {\n requestData: response.config.data as unknown,\n requestParams: response.config.params as unknown,\n url: response.config.url,\n },\n duration,\n level: response.status >= 200 && response.status < 300 ? CommonDbLogLevel.TRACE : CommonDbLogLevel.ERROR,\n topic: 'RESPONSE',\n }]);\n\n return response;\n }\n\n public onResponseRejected(error: unknown): void {\n if (isAxiosError(error)) {\n if (AxiosUtil.isAxiosCanceledError(error)) {\n return;\n }\n const requestId = error?.config?.headers.get('X-REQUEST-ID') as string;\n const duration = new Date().getTime() - this.requestMap.get(requestId);\n this.log([{\n detail: {\n requestParams: error.config.params as unknown,\n responseData: error.response.data as unknown,\n status: error.response.status,\n url: error.config.url,\n },\n duration,\n level: CommonDbLogLevel.ERROR,\n topic: 'RESPONSE_ERROR',\n }]);\n } else {\n this.log([{\n detail: {\n error,\n },\n level: CommonDbLogLevel.ERROR,\n topic: 'RESPONSE_ERROR',\n }]);\n }\n }\n\n private sendLog(): void {\n if (!this.logItems.length || !AuthenticationService.getInstance()?.authContextProps?.isAuthenticated) {\n return;\n }\n if (document.location.href.includes('accept-invitation')) {\n return;\n }\n ApiService.getInstance().systemApi.log({\n log_items: this.logItems,\n }, {\n headers: {\n 'X-IGNORE-LOG': '1',\n },\n }).catch(() => 0);\n this.logItems = [];\n }\n}\n"],"mappings":";;;;;;;;;AAsBA,IAAa,IAAb,MAAa,EAAW;CACtB,OAAe;CAEf;CAEA,WAAsC,CAAC;CAEvC,cAAsB;EAEpB,AADA,KAAK,6BAAa,IAAI,IAAoB,GAC1C,kBAAkB;GAChB,KAAK,QAAQ;EACf,GAAG,EAAc,YAAY,CAAC,CAAC,OAAO,IAAI,eAAe;CAC3D;CAEA,OAAc,cAA0B;EAEtC,OADA,EAAW,aAAa,EAAQ,gBAAgB,cAAc,EAAW,kBAAkB,IAAI,EAAW,CAAC,GACpG,EAAW;CACpB;CAEA,WAAwB;EACtB,KAAK,QAAQ;CACf;CAEA,IAAW,GAA+B;EACxC,IAAM,qBAAY,IAAI,KAAK,EAAA,CAAE,YAAY,GACnC,IAAmB,EAAc,YAAY,CAAC,CAAC,OAAO,mBAAmB;EAC/E,KAAK,SAAS,KAAK,GAAG,EAAM,KAAqB,OACxC;GACL,YAAY,EAAW,WAAW;GAClC,QAAQ,EAAK,SAAS,KAAK,UAAU,EAAK,MAAM,IAAI;GACpD,UAAU,EAAK,YAAY;GAC3B,OAAO,EAAK;GACZ;GACA;GACA,OAAO,EAAK,SAAS;EACvB,EACD,CAAC;CACJ;CAEA,UAAiB,GAAiE;EAChF,IAAI,EAAQ,QAAQ,IAAI,cAAc,GACpC,OAAO;EAET,IAAM,IAAY,EAAW,WAAW;EAcxC,OAbA,EAAQ,QAAQ,IAAI,gBAAgB,CAAS,GAC7C,KAAK,WAAW,IAAI,oBAAW,IAAI,KAAK,EAAA,CAAE,QAAQ,CAAC,GAEnD,KAAK,IAAI,CAAC;GACR,QAAQ;IACN,aAAa,EAAQ;IACrB,eAAe,EAAQ;IACvB,KAAK,EAAQ;GACf;GACA,OAAO,EAAiB;GACxB,OAAO;EACT,CAAC,CAAC,GAEK;CACT;CAEA,oBAA2B,GAAwC;EACjE,IAAI,EAAS,OAAO,QAAQ,IAAI,cAAc,GAC5C,OAAO;EAGT,IAAM,IAAY,GAAU,QAAQ,QAAQ,IAAI,cAAc,GACxD,qBAAW,IAAI,KAAK,EAAA,CAAE,QAAQ,IAAI,KAAK,WAAW,IAAI,CAAS;EAarE,OAXA,KAAK,IAAI,CAAC;GACR,QAAQ;IACN,aAAa,EAAS,OAAO;IAC7B,eAAe,EAAS,OAAO;IAC/B,KAAK,EAAS,OAAO;GACvB;GACA;GACA,OAAO,EAAS,UAAU,OAAO,EAAS,SAAS,MAAM,EAAiB,QAAQ,EAAiB;GACnG,OAAO;EACT,CAAC,CAAC,GAEK;CACT;CAEA,mBAA0B,GAAsB;EAC9C,IAAI,EAAa,CAAK,GAAG;GACvB,IAAI,EAAU,qBAAqB,CAAK,GACtC;GAEF,IAAM,IAAY,GAAO,QAAQ,QAAQ,IAAI,cAAc,GACrD,qBAAW,IAAI,KAAK,EAAA,CAAE,QAAQ,IAAI,KAAK,WAAW,IAAI,CAAS;GACrE,KAAK,IAAI,CAAC;IACR,QAAQ;KACN,eAAe,EAAM,OAAO;KAC5B,cAAc,EAAM,SAAS;KAC7B,QAAQ,EAAM,SAAS;KACvB,KAAK,EAAM,OAAO;IACpB;IACA;IACA,OAAO,EAAiB;IACxB,OAAO;GACT,CAAC,CAAC;EACJ,OACE,KAAK,IAAI,CAAC;GACR,QAAQ,EACN,SACF;GACA,OAAO,EAAiB;GACxB,OAAO;EACT,CAAC,CAAC;CAEN;CAEA,UAAwB;EAClB,CAAC,KAAK,SAAS,UAAU,CAAC,EAAsB,YAAY,CAAC,EAAE,kBAAkB,mBAGjF,SAAS,SAAS,KAAK,SAAS,mBAAmB,MAGvD,EAAW,YAAY,CAAC,CAAC,UAAU,IAAI,EACrC,WAAW,KAAK,SAClB,GAAG,EACD,SAAS,EACP,gBAAgB,IAClB,EACF,CAAC,CAAC,CAAC,YAAY,CAAC,GAChB,KAAK,WAAW,CAAC;CACnB;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './NavigationHistoryService';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { HmrUtil as e } from "@gen-epix/ui-core/utils/HmrUtil";
|
|
2
|
+
//#region src/classes/services/NavigationHistoryService/NavigationHistoryService.ts
|
|
3
|
+
var t = class t {
|
|
4
|
+
static __instance;
|
|
5
|
+
navigationHistory = [];
|
|
6
|
+
constructor() {}
|
|
7
|
+
static getInstance() {
|
|
8
|
+
return t.__instance = e.getHmrSingleton("navigationHistoryService", t.__instance, () => new t()), t.__instance;
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
//#endregion
|
|
12
|
+
export { t as NavigationHistoryService };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/classes/services/NavigationHistoryService/NavigationHistoryService.ts"],"sourcesContent":["import { HmrUtil } from '@gen-epix/ui-core/utils/HmrUtil';\n\nexport class NavigationHistoryService {\n private static __instance: NavigationHistoryService;\n\n public readonly navigationHistory: string[] = [];\n\n private constructor() {\n //\n }\n\n public static getInstance(): NavigationHistoryService {\n NavigationHistoryService.__instance = HmrUtil.getHmrSingleton('navigationHistoryService', NavigationHistoryService.__instance, () => new NavigationHistoryService());\n return NavigationHistoryService.__instance;\n }\n}\n"],"mappings":";;AAEA,IAAa,IAAb,MAAa,EAAyB;CACpC,OAAe;CAEf,oBAA8C,CAAC;CAE/C,cAAsB,CAEtB;CAEA,OAAc,cAAwC;EAEpD,OADA,EAAyB,aAAa,EAAQ,gBAAgB,4BAA4B,EAAyB,kBAAkB,IAAI,EAAyB,CAAC,GAC5J,EAAyB;CAClC;AACF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SubscribableAbstract } from '@gen-epix/ui-core/classes/abstracts/SubscribableAbstract';
|
|
2
|
+
import { Notification } from '../../../models/notification';
|
|
3
|
+
export declare class NotificationService extends SubscribableAbstract<Notification[]> {
|
|
4
|
+
private static __instance;
|
|
5
|
+
private readonly notificationTimeouts;
|
|
6
|
+
private constructor();
|
|
7
|
+
static getInstance(): NotificationService;
|
|
8
|
+
clearNotification(key: string): void;
|
|
9
|
+
clearNotifications(): void;
|
|
10
|
+
fulfillNotification(key: string, message: Notification['message'], severity: Notification['severity']): void;
|
|
11
|
+
hideAllNotifications(): void;
|
|
12
|
+
hideNotification(key: string): void;
|
|
13
|
+
showNotification(notification: Omit<Notification, 'key' | 'timestamp' | 'visible'>): string;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './NotificationService';
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { ConfigService as e } from "../ConfigService/index.js";
|
|
2
|
+
import { StringUtil as t } from "@gen-epix/ui-core/utils/StringUtil";
|
|
3
|
+
import { HmrUtil as n } from "@gen-epix/ui-core/utils/HmrUtil";
|
|
4
|
+
import { Subject as r } from "@gen-epix/ui-core/classes/Subject";
|
|
5
|
+
import { SubscribableAbstract as i } from "@gen-epix/ui-core/classes/abstracts/SubscribableAbstract";
|
|
6
|
+
//#region src/classes/services/NotificationService/NotificationService.ts
|
|
7
|
+
var a = class a extends i {
|
|
8
|
+
static __instance;
|
|
9
|
+
notificationTimeouts;
|
|
10
|
+
constructor() {
|
|
11
|
+
super(new r([])), this.notificationTimeouts = {};
|
|
12
|
+
}
|
|
13
|
+
static getInstance() {
|
|
14
|
+
return a.__instance = n.getHmrSingleton("notificationService", a.__instance, () => new a()), a.__instance;
|
|
15
|
+
}
|
|
16
|
+
clearNotification(e) {
|
|
17
|
+
this.subject.next(this.subject.data.filter((t) => t.key !== e)), this.notificationTimeouts[e] && (clearTimeout(this.notificationTimeouts[e]), delete this.notificationTimeouts[e]);
|
|
18
|
+
}
|
|
19
|
+
clearNotifications() {
|
|
20
|
+
this.subject.next([]), Object.keys(this.notificationTimeouts).forEach((e) => {
|
|
21
|
+
clearTimeout(this.notificationTimeouts[e]), delete this.notificationTimeouts[e];
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
fulfillNotification(e, t, n) {
|
|
25
|
+
this.subject.next(this.subject.data.map((r) => r.key === e ? {
|
|
26
|
+
...r,
|
|
27
|
+
isLoading: !1,
|
|
28
|
+
message: t,
|
|
29
|
+
severity: n
|
|
30
|
+
} : r));
|
|
31
|
+
}
|
|
32
|
+
hideAllNotifications() {
|
|
33
|
+
this.subject.next(this.subject.data.map((e) => ({
|
|
34
|
+
...e,
|
|
35
|
+
visible: !1
|
|
36
|
+
})));
|
|
37
|
+
}
|
|
38
|
+
hideNotification(e) {
|
|
39
|
+
this.subject.next(this.subject.data.map((t) => t.key === e ? {
|
|
40
|
+
...t,
|
|
41
|
+
visible: !1
|
|
42
|
+
} : t)), clearTimeout(this.notificationTimeouts[e]), delete this.notificationTimeouts[e];
|
|
43
|
+
}
|
|
44
|
+
showNotification(n) {
|
|
45
|
+
let r = t.createUuid(), i = n.autoHideAfterMs ?? e.getInstance().config.notifications.autoHideAfterMs;
|
|
46
|
+
return this.subject.next([{
|
|
47
|
+
...n,
|
|
48
|
+
autoHideAfterMs: i,
|
|
49
|
+
key: r,
|
|
50
|
+
timestamp: (/* @__PURE__ */ new Date()).getTime(),
|
|
51
|
+
visible: !0
|
|
52
|
+
}, ...this.subject.data]), isFinite(i) && (this.notificationTimeouts[r] = setTimeout(() => {
|
|
53
|
+
this.subject.next(this.subject.data.map((e) => e.key === r ? {
|
|
54
|
+
...e,
|
|
55
|
+
visible: !1
|
|
56
|
+
} : e));
|
|
57
|
+
}, i)), r;
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
//#endregion
|
|
61
|
+
export { a as NotificationService };
|
|
62
|
+
|
|
63
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/classes/services/NotificationService/NotificationService.ts"],"sourcesContent":["import { StringUtil } from '@gen-epix/ui-core/utils/StringUtil';\nimport { SubscribableAbstract } from '@gen-epix/ui-core/classes/abstracts/SubscribableAbstract';\nimport { Subject } from '@gen-epix/ui-core/classes/Subject';\nimport { HmrUtil } from '@gen-epix/ui-core/utils/HmrUtil';\n\nimport { ConfigService } from '../ConfigService';\nimport type { Notification } from '../../../models/notification';\n\nexport class NotificationService extends SubscribableAbstract<Notification[]> {\n private static __instance: NotificationService;\n\n private readonly notificationTimeouts: Record<string, ReturnType<typeof setTimeout>>;\n\n private constructor() {\n super(new Subject<Notification[]>([]));\n this.notificationTimeouts = {};\n }\n\n public static getInstance(): NotificationService {\n NotificationService.__instance = HmrUtil.getHmrSingleton('notificationService', NotificationService.__instance, () => new NotificationService());\n return NotificationService.__instance;\n }\n\n public clearNotification(key: string): void {\n this.subject.next(this.subject.data.filter(x => x.key !== key));\n if (this.notificationTimeouts[key]) {\n clearTimeout(this.notificationTimeouts[key]);\n delete this.notificationTimeouts[key];\n }\n }\n\n public clearNotifications(): void {\n this.subject.next([]);\n Object.keys(this.notificationTimeouts).forEach(key => {\n clearTimeout(this.notificationTimeouts[key]);\n delete this.notificationTimeouts[key];\n });\n }\n\n public fulfillNotification(key: string, message: Notification['message'], severity: Notification['severity']): void {\n this.subject.next(this.subject.data.map(x => {\n if (x.key === key) {\n return {\n ...x,\n isLoading: false,\n message,\n severity,\n };\n }\n return x;\n }));\n }\n\n public hideAllNotifications(): void {\n this.subject.next(this.subject.data.map(x => ({\n ...x,\n visible: false,\n })));\n }\n\n public hideNotification(key: string): void {\n this.subject.next(this.subject.data.map(x => {\n if (x.key === key) {\n return {\n ...x,\n visible: false,\n };\n }\n return x;\n }));\n clearTimeout(this.notificationTimeouts[key]);\n delete this.notificationTimeouts[key];\n }\n\n public showNotification(notification: Omit<Notification, 'key' | 'timestamp' | 'visible'>): string {\n const key = StringUtil.createUuid();\n const autoHideAfterMs = notification.autoHideAfterMs ?? ConfigService.getInstance().config.notifications.autoHideAfterMs;\n\n this.subject.next([\n {\n ...notification,\n autoHideAfterMs,\n key,\n timestamp: new Date().getTime(),\n visible: true,\n },\n ...this.subject.data,\n ]);\n\n if (isFinite(autoHideAfterMs)) {\n this.notificationTimeouts[key] = setTimeout(() => {\n this.subject.next(this.subject.data.map(x => {\n if (x.key === key) {\n return {\n ...x,\n visible: false,\n };\n }\n return x;\n }));\n }, autoHideAfterMs);\n }\n return key;\n }\n}\n"],"mappings":";;;;;;AAQA,IAAa,IAAb,MAAa,UAA4B,EAAqC;CAC5E,OAAe;CAEf;CAEA,cAAsB;EAEpB,AADA,MAAM,IAAI,EAAwB,CAAC,CAAC,CAAC,GACrC,KAAK,uBAAuB,CAAC;CAC/B;CAEA,OAAc,cAAmC;EAE/C,OADA,EAAoB,aAAa,EAAQ,gBAAgB,uBAAuB,EAAoB,kBAAkB,IAAI,EAAoB,CAAC,GACxI,EAAoB;CAC7B;CAEA,kBAAyB,GAAmB;EAE1C,AADA,KAAK,QAAQ,KAAK,KAAK,QAAQ,KAAK,QAAO,MAAK,EAAE,QAAQ,CAAG,CAAC,GAC1D,KAAK,qBAAqB,OAC5B,aAAa,KAAK,qBAAqB,EAAI,GAC3C,OAAO,KAAK,qBAAqB;CAErC;CAEA,qBAAkC;EAEhC,AADA,KAAK,QAAQ,KAAK,CAAC,CAAC,GACpB,OAAO,KAAK,KAAK,oBAAoB,CAAC,CAAC,SAAQ,MAAO;GAEpD,AADA,aAAa,KAAK,qBAAqB,EAAI,GAC3C,OAAO,KAAK,qBAAqB;EACnC,CAAC;CACH;CAEA,oBAA2B,GAAa,GAAkC,GAA0C;EAClH,KAAK,QAAQ,KAAK,KAAK,QAAQ,KAAK,KAAI,MAClC,EAAE,QAAQ,IACL;GACL,GAAG;GACH,WAAW;GACX;GACA;EACF,IAEK,CACR,CAAC;CACJ;CAEA,uBAAoC;EAClC,KAAK,QAAQ,KAAK,KAAK,QAAQ,KAAK,KAAI,OAAM;GAC5C,GAAG;GACH,SAAS;EACX,EAAE,CAAC;CACL;CAEA,iBAAwB,GAAmB;EAWzC,AAVA,KAAK,QAAQ,KAAK,KAAK,QAAQ,KAAK,KAAI,MAClC,EAAE,QAAQ,IACL;GACL,GAAG;GACH,SAAS;EACX,IAEK,CACR,CAAC,GACF,aAAa,KAAK,qBAAqB,EAAI,GAC3C,OAAO,KAAK,qBAAqB;CACnC;CAEA,iBAAwB,GAA2E;EACjG,IAAM,IAAM,EAAW,WAAW,GAC5B,IAAkB,EAAa,mBAAmB,EAAc,YAAY,CAAC,CAAC,OAAO,cAAc;EA0BzG,OAxBA,KAAK,QAAQ,KAAK,CAChB;GACE,GAAG;GACH;GACA;GACA,4BAAW,IAAI,KAAK,EAAA,CAAE,QAAQ;GAC9B,SAAS;EACX,GACA,GAAG,KAAK,QAAQ,IAClB,CAAC,GAEG,SAAS,CAAe,MAC1B,KAAK,qBAAqB,KAAO,iBAAiB;GAChD,KAAK,QAAQ,KAAK,KAAK,QAAQ,KAAK,KAAI,MAClC,EAAE,QAAQ,IACL;IACL,GAAG;IACH,SAAS;GACX,IAEK,CACR,CAAC;EACJ,GAAG,CAAe,IAEb;CACT;AACF"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { CommonDbUser } from '@gen-epix/api-commondb';
|
|
2
|
+
import { EventBusAbstract } from '@gen-epix/ui-core/classes/abstracts/EventBusAbstract';
|
|
3
|
+
type EpiEvent = {
|
|
4
|
+
changePage: Page;
|
|
5
|
+
changeUser: CommonDbUser;
|
|
6
|
+
click: {
|
|
7
|
+
context?: string;
|
|
8
|
+
label: string;
|
|
9
|
+
page?: Page;
|
|
10
|
+
type: 'button' | 'link' | 'table-row-index' | 'table-row';
|
|
11
|
+
};
|
|
12
|
+
error: Error;
|
|
13
|
+
};
|
|
14
|
+
type Page = {
|
|
15
|
+
location: Location;
|
|
16
|
+
pageName: string;
|
|
17
|
+
};
|
|
18
|
+
export declare class PageEventBusService extends EventBusAbstract<EpiEvent> {
|
|
19
|
+
private static __instance;
|
|
20
|
+
private lastPageEventPayload;
|
|
21
|
+
private constructor();
|
|
22
|
+
static getInstance(): PageEventBusService;
|
|
23
|
+
emit<TEventName extends keyof EpiEvent>(eventName: TEventName, payload?: EpiEvent[TEventName]): void;
|
|
24
|
+
getPage(): Page;
|
|
25
|
+
private setupClickEventListener;
|
|
26
|
+
private traverseDom;
|
|
27
|
+
}
|
|
28
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './PageEventBusService';
|