@openmrs/esm-styleguide 8.0.1-pre.3545 → 8.0.1-pre.3549

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-styleguide",
3
- "version": "8.0.1-pre.3545",
3
+ "version": "8.0.1-pre.3549",
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.3545",
102
- "@openmrs/esm-config": "8.0.1-pre.3545",
103
- "@openmrs/esm-emr-api": "8.0.1-pre.3545",
104
- "@openmrs/esm-error-handling": "8.0.1-pre.3545",
105
- "@openmrs/esm-extensions": "8.0.1-pre.3545",
106
- "@openmrs/esm-globals": "8.0.1-pre.3545",
107
- "@openmrs/esm-navigation": "8.0.1-pre.3545",
108
- "@openmrs/esm-react-utils": "8.0.1-pre.3545",
109
- "@openmrs/esm-state": "8.0.1-pre.3545",
110
- "@openmrs/esm-translations": "8.0.1-pre.3545",
111
- "@openmrs/esm-utils": "8.0.1-pre.3545",
101
+ "@openmrs/esm-api": "8.0.1-pre.3549",
102
+ "@openmrs/esm-config": "8.0.1-pre.3549",
103
+ "@openmrs/esm-emr-api": "8.0.1-pre.3549",
104
+ "@openmrs/esm-error-handling": "8.0.1-pre.3549",
105
+ "@openmrs/esm-extensions": "8.0.1-pre.3549",
106
+ "@openmrs/esm-globals": "8.0.1-pre.3549",
107
+ "@openmrs/esm-navigation": "8.0.1-pre.3549",
108
+ "@openmrs/esm-react-utils": "8.0.1-pre.3549",
109
+ "@openmrs/esm-state": "8.0.1-pre.3549",
110
+ "@openmrs/esm-translations": "8.0.1-pre.3549",
111
+ "@openmrs/esm-utils": "8.0.1-pre.3549",
112
112
  "@rspack/cli": "^1.3.11",
113
113
  "@rspack/core": "^1.3.11",
114
114
  "@types/geopattern": "^1.2.9",
@@ -47,6 +47,7 @@ body {
47
47
  height: calc(100vh - var(--omrs-navbar-height));
48
48
  top: var(--omrs-navbar-height);
49
49
  z-index: 9000;
50
+ will-change: contents;
50
51
  }
51
52
 
52
53
  #omrs-top-nav-app-container {
@@ -1,4 +1,5 @@
1
1
  import React, { useEffect, useMemo, useState } from 'react';
2
+ import classNames from 'classnames';
2
3
  import Parcel from 'single-spa-react/parcel';
3
4
  import { mountRootParcel, type ParcelConfig } from 'single-spa';
4
5
  import { InlineLoading } from '@carbon/react';
@@ -7,6 +8,7 @@ import { loadLifeCycles } from '@openmrs/esm-routes';
7
8
  import { getCoreTranslation } from '@openmrs/esm-translations';
8
9
  import { promptForClosingWorkspaces, useWorkspace2Store } from './workspace2';
9
10
  import { type Workspace2DefinitionProps } from './workspace2.component';
11
+ import styles from './workspace2.module.scss';
10
12
 
11
13
  interface WorkspaceWindowProps {
12
14
  openedWindow: OpenedWindow;
@@ -110,11 +112,41 @@ const ActiveWorkspace: React.FC<ActiveWorkspaceProps> = ({
110
112
  [openedWorkspace, closeWorkspace, openedGroup, openedWindow],
111
113
  );
112
114
 
113
- return lifeCycle ? (
114
- <Parcel key={openedWorkspace.workspaceName} config={lifeCycle} mountParcel={mountRootParcel} {...props} />
115
- ) : (
116
- <InlineLoading description={`${getCoreTranslation('loading')} ...`} />
117
- );
115
+ if (!lifeCycle) {
116
+ const { registeredWorkspacesByName } = workspace2Store.getState();
117
+ const workspaceDef = registeredWorkspacesByName[openedWorkspace.workspaceName];
118
+ const windowName = workspaceDef?.window;
119
+ const { registeredWindowsByName } = workspace2Store.getState();
120
+ const windowDef = registeredWindowsByName[windowName];
121
+ const width = windowDef?.width ?? 'narrow';
122
+
123
+ return (
124
+ <div
125
+ className={classNames(styles.workspaceOuterContainer, {
126
+ [styles.narrowWorkspace]: width === 'narrow',
127
+ [styles.widerWorkspace]: width === 'wider',
128
+ [styles.extraWideWorkspace]: width === 'extra-wide',
129
+ })}
130
+ >
131
+ <div className={styles.workspaceSpacer} />
132
+ <div
133
+ className={classNames(styles.workspaceMiddleContainer, {
134
+ [styles.isRootWorkspace]: isRootWorkspace,
135
+ })}
136
+ >
137
+ <div
138
+ className={classNames(styles.workspaceInnerContainer, {
139
+ [styles.isRootWorkspace]: isRootWorkspace,
140
+ })}
141
+ >
142
+ <InlineLoading className={styles.loader} description={`${getCoreTranslation('loading')} ...`} />
143
+ </div>
144
+ </div>
145
+ </div>
146
+ );
147
+ }
148
+
149
+ return <Parcel key={openedWorkspace.workspaceName} config={lifeCycle} mountParcel={mountRootParcel} {...props} />;
118
150
  };
119
151
 
120
152
  export default ActiveWorkspaceWindow;
@@ -2,8 +2,10 @@
2
2
  position: relative;
3
3
  display: flex;
4
4
  height: 100%;
5
+ contain: content;
5
6
 
6
7
  &.overlay {
8
+ contain: none;
7
9
  position: absolute;
8
10
  right: 0;
9
11
  top: 0;
@@ -35,9 +35,10 @@ $extraWideWorkspaceWidth: 48.25rem;
35
35
  bottom: 0;
36
36
  inset-inline-end: var(--actionPanelOffset);
37
37
  z-index: 100;
38
+ will-change: transform;
38
39
 
39
40
  &.isRootWorkspace {
40
- animation: growToWidth 0.5s ease-in-out;
41
+ animation: slideFromRight 0.5s ease-in-out;
41
42
  }
42
43
 
43
44
  transition: width 0.5s ease-in-out;
@@ -49,12 +50,12 @@ $extraWideWorkspaceWidth: 48.25rem;
49
50
  width: 0;
50
51
  }
51
52
 
52
- @keyframes growToWidth {
53
+ @keyframes slideFromRight {
53
54
  from {
54
- width: 0;
55
+ transform: translateX(100%);
55
56
  }
56
57
  to {
57
- width: inherit;
58
+ transform: translateX(0);
58
59
  }
59
60
  }
60
61
  }
@@ -69,6 +70,7 @@ $extraWideWorkspaceWidth: 48.25rem;
69
70
  width: var(--workspaceWidth);
70
71
  border-inline-start: 1px solid $text-03;
71
72
  background-color: #fff;
73
+ will-change: width;
72
74
 
73
75
  transition: width 0.5s ease-in-out;
74
76
 
@@ -85,6 +87,7 @@ $extraWideWorkspaceWidth: 48.25rem;
85
87
  .workspaceSpacer {
86
88
  width: inherit;
87
89
  height: 100%;
90
+ will-change: width;
88
91
  animation: growToWidth 0.5s ease-in-out;
89
92
 
90
93
  &.hidden {
@@ -113,9 +116,9 @@ $extraWideWorkspaceWidth: 48.25rem;
113
116
 
114
117
  .loader {
115
118
  display: flex;
116
- background-color: $openmrs-background-grey;
117
119
  justify-content: center;
118
- min-height: layout.$spacing-09;
120
+ align-items: center;
121
+ min-height: 50%;
119
122
  }
120
123
 
121
124
  .hiddenExtraWorkspace {