@abpjs/theme-shared 2.9.0 → 3.1.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/dist/components/loader-bar/LoaderBar.d.ts +1 -1
- package/dist/enums/index.d.ts +5 -0
- package/dist/enums/route-names.d.ts +15 -0
- package/dist/handlers/error.handler.d.ts +34 -2
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/use-nav-items.d.ts +33 -0
- package/dist/index.d.ts +16 -1
- package/dist/index.js +416 -245
- package/dist/index.mjs +270 -102
- package/dist/models/confirmation.d.ts +3 -7
- package/dist/models/index.d.ts +7 -2
- package/dist/models/nav-item.d.ts +89 -0
- package/dist/models/toaster.d.ts +2 -44
- package/dist/providers/ThemeSharedProvider.d.ts +1 -1
- package/dist/providers/index.d.ts +1 -0
- package/dist/providers/route.provider.d.ts +53 -0
- package/dist/services/index.d.ts +5 -0
- package/dist/services/nav-items.service.d.ts +119 -0
- package/dist/utils/index.d.ts +4 -1
- package/package.json +5 -4
|
@@ -42,5 +42,5 @@ export interface LoaderBarProps {
|
|
|
42
42
|
* />
|
|
43
43
|
* ```
|
|
44
44
|
*/
|
|
45
|
-
export declare function LoaderBar({ containerClass, progressClass, filter, intervalPeriod, stopDelay, }: LoaderBarProps): import("react/jsx-runtime").JSX.Element | null;
|
|
45
|
+
export declare function LoaderBar({ containerClass, progressClass, filter: _filter, intervalPeriod, stopDelay, }: LoaderBarProps): import("react/jsx-runtime").JSX.Element | null;
|
|
46
46
|
export default LoaderBar;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Theme Shared Route Names
|
|
3
|
+
* Translated from @abp/ng.theme.shared/lib/enums/route-names.ts v3.0.0
|
|
4
|
+
*
|
|
5
|
+
* @since 3.0.0
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Enum for theme shared route names.
|
|
9
|
+
* These are used for navigation and route registration.
|
|
10
|
+
*
|
|
11
|
+
* @since 3.0.0
|
|
12
|
+
*/
|
|
13
|
+
export declare enum eThemeSharedRouteNames {
|
|
14
|
+
Administration = "AbpUiNavigation::Menu:Administration"
|
|
15
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Confirmation } from '../models';
|
|
2
2
|
import { ErrorComponentProps } from '../components/errors/ErrorComponent';
|
|
3
3
|
type NavigateFunction = (to: string) => void;
|
|
4
4
|
/**
|
|
@@ -28,12 +28,13 @@ export interface ErrorComponentInstance {
|
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
30
|
* Error handler interface.
|
|
31
|
+
* @since 3.0.0 - showError now returns Confirmation.Status instead of Toaster.Status
|
|
31
32
|
*/
|
|
32
33
|
export interface ErrorHandler {
|
|
33
34
|
/** Handle an HTTP error response */
|
|
34
35
|
handleError: (error: HttpErrorResponse) => Promise<void>;
|
|
35
36
|
/** Show an error message in a confirmation dialog */
|
|
36
|
-
showError: (message: string, title?: string) => Promise<
|
|
37
|
+
showError: (message: string, title?: string) => Promise<Confirmation.Status>;
|
|
37
38
|
/** Navigate to the login page */
|
|
38
39
|
navigateToLogin: () => void;
|
|
39
40
|
/** Create error component props for full-page error display */
|
|
@@ -43,6 +44,37 @@ export interface ErrorHandler {
|
|
|
43
44
|
/** Clear the current error component */
|
|
44
45
|
clearErrorComponent: () => void;
|
|
45
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Default error messages for common HTTP status codes.
|
|
49
|
+
*/
|
|
50
|
+
export declare const DEFAULT_ERROR_MESSAGES: Record<number, string>;
|
|
51
|
+
/**
|
|
52
|
+
* Default error localizations with title and details.
|
|
53
|
+
* These are the localization keys used for error messages.
|
|
54
|
+
* @since 3.1.0
|
|
55
|
+
*/
|
|
56
|
+
export declare const DEFAULT_ERROR_LOCALIZATIONS: {
|
|
57
|
+
readonly defaultError: {
|
|
58
|
+
readonly title: "AbpUi::DefaultErrorMessage";
|
|
59
|
+
readonly details: "AbpUi::DefaultErrorMessageDetail";
|
|
60
|
+
};
|
|
61
|
+
readonly defaultError401: {
|
|
62
|
+
readonly title: "AbpUi::DefaultErrorMessage401";
|
|
63
|
+
readonly details: "AbpUi::DefaultErrorMessage401Detail";
|
|
64
|
+
};
|
|
65
|
+
readonly defaultError403: {
|
|
66
|
+
readonly title: "AbpUi::DefaultErrorMessage403";
|
|
67
|
+
readonly details: "AbpUi::DefaultErrorMessage403Detail";
|
|
68
|
+
};
|
|
69
|
+
readonly defaultError404: {
|
|
70
|
+
readonly title: "AbpUi::DefaultErrorMessage404";
|
|
71
|
+
readonly details: "AbpUi::DefaultErrorMessage404Detail";
|
|
72
|
+
};
|
|
73
|
+
readonly defaultError500: {
|
|
74
|
+
readonly title: "AbpUi::DefaultErrorMessage500";
|
|
75
|
+
readonly details: "AbpUi::DefaultErrorMessage500Detail";
|
|
76
|
+
};
|
|
77
|
+
};
|
|
46
78
|
export interface UseErrorHandlerOptions {
|
|
47
79
|
/**
|
|
48
80
|
* Custom navigate function. If not provided, navigation to login will be a no-op.
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { useToaster, useToasts, useToasterContext } from '../contexts/toaster.context';
|
|
2
2
|
export { useConfirmation, useConfirmationState, useConfirmationContext } from '../contexts/confirmation.context';
|
|
3
3
|
export { useErrorHandler } from '../handlers/error.handler';
|
|
4
|
+
export { useNavItems } from './use-nav-items';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useNavItems Hook
|
|
3
|
+
* @since 3.0.0
|
|
4
|
+
*
|
|
5
|
+
* React hook for subscribing to NavItemsService changes.
|
|
6
|
+
*/
|
|
7
|
+
import { NavItem } from '../models/nav-item';
|
|
8
|
+
import { NavItemsService } from '../services/nav-items.service';
|
|
9
|
+
/**
|
|
10
|
+
* Hook to subscribe to nav items from NavItemsService.
|
|
11
|
+
* Returns the current sorted array of nav items.
|
|
12
|
+
*
|
|
13
|
+
* @param service - Optional NavItemsService instance (defaults to singleton)
|
|
14
|
+
* @returns Array of NavItem objects, sorted by order
|
|
15
|
+
*
|
|
16
|
+
* @since 3.0.0
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* function MyNavComponent() {
|
|
21
|
+
* const navItems = useNavItems();
|
|
22
|
+
*
|
|
23
|
+
* return (
|
|
24
|
+
* <ul>
|
|
25
|
+
* {navItems.map((item) => (
|
|
26
|
+
* <li key={item.id}>{item.id}</li>
|
|
27
|
+
* ))}
|
|
28
|
+
* </ul>
|
|
29
|
+
* );
|
|
30
|
+
* }
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare function useNavItems(service?: NavItemsService): NavItem[];
|
package/dist/index.d.ts
CHANGED
|
@@ -2,11 +2,24 @@
|
|
|
2
2
|
* @abpjs/theme-shared
|
|
3
3
|
*
|
|
4
4
|
* ABP Framework Theme Shared components for React.
|
|
5
|
-
* Translated from @abp/ng.theme.shared
|
|
5
|
+
* Translated from @abp/ng.theme.shared v3.0.0
|
|
6
6
|
*
|
|
7
7
|
* This package provides shared UI components, services, and utilities
|
|
8
8
|
* for theme/modal management in ABP Framework React applications.
|
|
9
9
|
*
|
|
10
|
+
* Changes in v3.0.0:
|
|
11
|
+
* - Added NavItemsService (replaces nav-items utility functions)
|
|
12
|
+
* - Added NavItem.id property (required unique identifier)
|
|
13
|
+
* - Changed NavItem.permission to NavItem.requiredPolicy
|
|
14
|
+
* - Added eThemeSharedRouteNames enum for route names
|
|
15
|
+
* - Added THEME_SHARED_ROUTE_PROVIDERS and configureRoutes
|
|
16
|
+
* - Added initializeThemeSharedRoutes for easy route setup
|
|
17
|
+
* - Removed Toaster.Status enum (use Confirmation.Status instead)
|
|
18
|
+
* - Removed Confirmation.Options.closable (use dismissible instead)
|
|
19
|
+
* - Removed setting-management model (use @abpjs/core SettingTabsService)
|
|
20
|
+
* - Removed nav-items utils (use NavItemsService)
|
|
21
|
+
* - Dependency updates to @abp/ng.core v3.0.0
|
|
22
|
+
*
|
|
10
23
|
* Changes in v2.9.0:
|
|
11
24
|
* - Added LocaleDirection type for RTL/LTR support
|
|
12
25
|
* - Added LazyStyleHandler for RTL/LTR style switching
|
|
@@ -78,3 +91,5 @@ export * from './providers';
|
|
|
78
91
|
export * from './handlers';
|
|
79
92
|
export * from './utils';
|
|
80
93
|
export * from './theme';
|
|
94
|
+
export * from './enums';
|
|
95
|
+
export * from './services';
|