@bluealba/pae-ui-react-core 4.0.1-feature-add-documentation-templat-1205 → 4.0.1-feature-menu-display-order-1213
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/index.cjs.js +43 -43
- package/dist/index.esm.js +870 -862
- package/dist/index.systemjs.js +44 -44
- package/dist/index.umd.js +44 -44
- package/dist/src/hooks/applications/ApplicationMenu.d.ts +2 -0
- package/dist/src/hooks/applications/sortByDisplayOrder.d.ts +10 -0
- package/dist/src/hooks/applications/useApplicationMenu.d.ts +1 -3
- package/dist/src/hooks/applications/useModuleMenu.d.ts +11 -0
- package/dist/src/hooks/index.d.ts +3 -2
- package/package.json +1 -1
- package/dist/src/hooks/applications/useApplicationMenuWithDocumentation.d.ts +0 -9
|
@@ -5,6 +5,7 @@ export type AplicationMenuSubItem = {
|
|
|
5
5
|
path?: string;
|
|
6
6
|
Icon?: React.ReactNode;
|
|
7
7
|
operations?: string[];
|
|
8
|
+
displayOrder?: number;
|
|
8
9
|
};
|
|
9
10
|
export type ApplicationMenuItem = {
|
|
10
11
|
label: string;
|
|
@@ -16,5 +17,6 @@ export type ApplicationMenuItem = {
|
|
|
16
17
|
canCollapse?: boolean;
|
|
17
18
|
externalUrl?: string;
|
|
18
19
|
target?: '_self' | '_blank';
|
|
20
|
+
displayOrder?: number;
|
|
19
21
|
};
|
|
20
22
|
export type ApplicationMenu = ApplicationMenuItem[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sorts items by displayOrder in descending order (higher numbers first).
|
|
3
|
+
* Items without displayOrder maintain their original order (stable sort).
|
|
4
|
+
*
|
|
5
|
+
* @param items - Array of items to sort
|
|
6
|
+
* @returns New sorted array
|
|
7
|
+
*/
|
|
8
|
+
export declare function sortByDisplayOrder<T extends {
|
|
9
|
+
displayOrder?: number;
|
|
10
|
+
}>(items: T[]): T[];
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { ApplicationMenu } from './ApplicationMenu';
|
|
2
1
|
import { PlatformApplication } from './PlatformApplication';
|
|
3
|
-
import {
|
|
2
|
+
import { ApplicationMenu } from './ApplicationMenu';
|
|
4
3
|
|
|
5
4
|
type UseApplicationMenuReturnType = {
|
|
6
5
|
loading: boolean;
|
|
@@ -8,4 +7,3 @@ type UseApplicationMenuReturnType = {
|
|
|
8
7
|
};
|
|
9
8
|
export declare const useApplicationMenu: (application: PlatformApplication | undefined) => UseApplicationMenuReturnType;
|
|
10
9
|
export default useApplicationMenu;
|
|
11
|
-
export declare const hasAccess: (authorizedOperations: Operation[]) => (operations: string[]) => boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Operation } from '@bluealba/pae-core';
|
|
2
|
+
import { ApplicationMenu } from './ApplicationMenu';
|
|
3
|
+
import { PlatformApplication } from './PlatformApplication';
|
|
4
|
+
|
|
5
|
+
type UseModuleMenuReturnType = {
|
|
6
|
+
loading: boolean;
|
|
7
|
+
menu: ApplicationMenu;
|
|
8
|
+
};
|
|
9
|
+
export declare const useModuleMenu: (application: PlatformApplication | undefined) => UseModuleMenuReturnType;
|
|
10
|
+
export default useModuleMenu;
|
|
11
|
+
export declare const hasAccess: (authorizedOperations: Operation[]) => (operations: string[]) => boolean;
|
|
@@ -12,15 +12,16 @@ export { useApplications } from './applications/useApplications';
|
|
|
12
12
|
export { useUIApplications } from './useUIApplications';
|
|
13
13
|
export { useApplicationUIModule } from './applications/useApplicationUIModule';
|
|
14
14
|
export { useApplicationIcon } from './applications/useApplicationIcon';
|
|
15
|
-
export {
|
|
15
|
+
export { useModuleMenu } from './applications/useModuleMenu';
|
|
16
16
|
export { useDocumentationMenuItems } from './applications/useDocumentationMenuItems';
|
|
17
|
-
export {
|
|
17
|
+
export { useApplicationMenu } from './applications/useApplicationMenu';
|
|
18
18
|
export { useCurrentApplicationName } from './applications/useCurrentApplicationName';
|
|
19
19
|
export { useApplicationJSModule } from './applications/useApplicationJSModule';
|
|
20
20
|
export { useCurrentApplication } from './applications/useCurrentApplication';
|
|
21
21
|
export { useCurrentJSModule } from './applications/useCurrentJSModule';
|
|
22
22
|
export { type ApplicationMenu, type ApplicationMenuItem } from './applications/ApplicationMenu';
|
|
23
23
|
export { type PlatformApplication } from './applications/PlatformApplication';
|
|
24
|
+
export { sortByDisplayOrder } from './applications/sortByDisplayOrder';
|
|
24
25
|
export { useAuth } from './useAuth';
|
|
25
26
|
export { useOperations } from './useOperations';
|
|
26
27
|
export { useServiceInvoker, type ServiceInvoker } from './useServiceInvoker';
|
package/package.json
CHANGED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { PlatformApplication } from './PlatformApplication';
|
|
2
|
-
import { ApplicationMenu } from './ApplicationMenu';
|
|
3
|
-
|
|
4
|
-
type UseApplicationMenuWithDocumentationReturnType = {
|
|
5
|
-
loading: boolean;
|
|
6
|
-
menu: ApplicationMenu;
|
|
7
|
-
};
|
|
8
|
-
export declare const useApplicationMenuWithDocumentation: (application: PlatformApplication | undefined) => UseApplicationMenuWithDocumentationReturnType;
|
|
9
|
-
export default useApplicationMenuWithDocumentation;
|