@openmrs/esm-styleguide 8.0.1-pre.3662 → 8.0.1-pre.3663
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/.turbo/turbo-build.log +2 -2
- package/dist/openmrs-esm-styleguide.js +1 -1
- package/dist/openmrs-esm-styleguide.js.map +1 -1
- package/dist/workspaces2/action-menu2/action-menu2.component.d.ts +3 -1
- package/package.json +12 -12
- package/src/workspaces2/action-menu2/action-menu-button2.component.tsx +3 -5
- package/src/workspaces2/action-menu2/action-menu2.component.tsx +11 -11
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { type WorkspaceGroupDefinition2 } from '@openmrs/esm-globals';
|
|
4
4
|
export interface ActionMenuProps {
|
|
5
|
-
workspaceGroup: WorkspaceGroupDefinition2
|
|
5
|
+
workspaceGroup: WorkspaceGroupDefinition2 & {
|
|
6
|
+
moduleName: string;
|
|
7
|
+
};
|
|
6
8
|
groupProps: Record<string, any> | null;
|
|
7
9
|
}
|
|
8
10
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openmrs/esm-styleguide",
|
|
3
|
-
"version": "8.0.1-pre.
|
|
3
|
+
"version": "8.0.1-pre.3663",
|
|
4
4
|
"license": "MPL-2.0",
|
|
5
5
|
"description": "The styleguide for OpenMRS SPA",
|
|
6
6
|
"main": "dist/openmrs-esm-styleguide.js",
|
|
@@ -98,17 +98,17 @@
|
|
|
98
98
|
"swr": "2.x"
|
|
99
99
|
},
|
|
100
100
|
"devDependencies": {
|
|
101
|
-
"@openmrs/esm-api": "8.0.1-pre.
|
|
102
|
-
"@openmrs/esm-config": "8.0.1-pre.
|
|
103
|
-
"@openmrs/esm-emr-api": "8.0.1-pre.
|
|
104
|
-
"@openmrs/esm-error-handling": "8.0.1-pre.
|
|
105
|
-
"@openmrs/esm-extensions": "8.0.1-pre.
|
|
106
|
-
"@openmrs/esm-globals": "8.0.1-pre.
|
|
107
|
-
"@openmrs/esm-navigation": "8.0.1-pre.
|
|
108
|
-
"@openmrs/esm-react-utils": "8.0.1-pre.
|
|
109
|
-
"@openmrs/esm-state": "8.0.1-pre.
|
|
110
|
-
"@openmrs/esm-translations": "8.0.1-pre.
|
|
111
|
-
"@openmrs/esm-utils": "8.0.1-pre.
|
|
101
|
+
"@openmrs/esm-api": "8.0.1-pre.3663",
|
|
102
|
+
"@openmrs/esm-config": "8.0.1-pre.3663",
|
|
103
|
+
"@openmrs/esm-emr-api": "8.0.1-pre.3663",
|
|
104
|
+
"@openmrs/esm-error-handling": "8.0.1-pre.3663",
|
|
105
|
+
"@openmrs/esm-extensions": "8.0.1-pre.3663",
|
|
106
|
+
"@openmrs/esm-globals": "8.0.1-pre.3663",
|
|
107
|
+
"@openmrs/esm-navigation": "8.0.1-pre.3663",
|
|
108
|
+
"@openmrs/esm-react-utils": "8.0.1-pre.3663",
|
|
109
|
+
"@openmrs/esm-state": "8.0.1-pre.3663",
|
|
110
|
+
"@openmrs/esm-translations": "8.0.1-pre.3663",
|
|
111
|
+
"@openmrs/esm-utils": "8.0.1-pre.3663",
|
|
112
112
|
"@rspack/cli": "^1.3.11",
|
|
113
113
|
"@rspack/core": "^1.3.11",
|
|
114
114
|
"@types/geopattern": "^1.2.9",
|
|
@@ -3,7 +3,7 @@ import React, { useContext } from 'react';
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import { Button, IconButton } from '@carbon/react';
|
|
5
5
|
import { SingleSpaContext } from 'single-spa-react';
|
|
6
|
-
import { useLayoutType } from '@openmrs/esm-react-utils';
|
|
6
|
+
import { ComponentContext, useLayoutType } from '@openmrs/esm-react-utils';
|
|
7
7
|
import { type OpenedWindow } from '@openmrs/esm-extensions';
|
|
8
8
|
import { launchWorkspace2, useWorkspace2Store } from '../workspace2';
|
|
9
9
|
import styles from './action-menu-button2.module.scss';
|
|
@@ -72,10 +72,8 @@ export const ActionMenuButton2: React.FC<ActionMenuButtonProps2> = ({
|
|
|
72
72
|
const layout = useLayoutType();
|
|
73
73
|
const { openedWindows, restoreWindow, isMostRecentlyOpenedWindowHidden } = useWorkspace2Store();
|
|
74
74
|
|
|
75
|
-
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
const openedWindowIndex = openedWindows.findIndex((w) => w.windowName === windowName);
|
|
75
|
+
const { extension } = useContext(ComponentContext);
|
|
76
|
+
const openedWindowIndex = openedWindows.findIndex((w) => w.windowName === extension?.extensionId);
|
|
79
77
|
// can be undefined if the window is not opened
|
|
80
78
|
const window: OpenedWindow | undefined = openedWindows[openedWindowIndex];
|
|
81
79
|
const isWindowOpened = window != null;
|
|
@@ -4,15 +4,16 @@ import Parcel from 'single-spa-react/parcel';
|
|
|
4
4
|
import { IconButton } from '@carbon/react';
|
|
5
5
|
import { mountRootParcel } from 'single-spa';
|
|
6
6
|
import { loadLifeCycles } from '@openmrs/esm-routes';
|
|
7
|
-
import { isDesktop, useLayoutType } from '@openmrs/esm-react-utils';
|
|
7
|
+
import { ComponentContext, isDesktop, useLayoutType } from '@openmrs/esm-react-utils';
|
|
8
8
|
import { type WorkspaceGroupDefinition2 } from '@openmrs/esm-globals';
|
|
9
9
|
import { getCoreTranslation } from '@openmrs/esm-translations';
|
|
10
10
|
import { closeWorkspaceGroup2, useWorkspace2Store } from '../workspace2';
|
|
11
11
|
import { CloseIcon } from '../../icons';
|
|
12
12
|
import styles from './action-menu2.module.scss';
|
|
13
|
+
import { ExtensionSlot } from '@openmrs/esm-framework';
|
|
13
14
|
|
|
14
15
|
export interface ActionMenuProps {
|
|
15
|
-
workspaceGroup: WorkspaceGroupDefinition2;
|
|
16
|
+
workspaceGroup: WorkspaceGroupDefinition2 & { moduleName: string };
|
|
16
17
|
groupProps: Record<string, any> | null;
|
|
17
18
|
}
|
|
18
19
|
|
|
@@ -48,15 +49,14 @@ export function ActionMenu({ workspaceGroup, groupProps }: ActionMenuProps) {
|
|
|
48
49
|
<CloseIcon />
|
|
49
50
|
</IconButton>
|
|
50
51
|
)}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
))}
|
|
52
|
+
<ComponentContext.Provider
|
|
53
|
+
value={{
|
|
54
|
+
moduleName: workspaceGroup.moduleName,
|
|
55
|
+
featureName: workspaceGroup.name,
|
|
56
|
+
}}
|
|
57
|
+
>
|
|
58
|
+
<ExtensionSlot name={workspaceGroup.name} state={{ groupProps }} />
|
|
59
|
+
</ComponentContext.Provider>
|
|
60
60
|
</div>
|
|
61
61
|
{isClosable && !isDesktop(layout) && (
|
|
62
62
|
<IconButton
|