@openmrs/esm-styleguide 6.1.0 → 6.1.1-pre.2723

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.
@@ -51,4 +51,4 @@ WARNING in webpack performance recommendations:
51
51
  You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.
52
52
  For more info visit https://webpack.js.org/guides/code-splitting/
53
53
 
54
- webpack 5.88.0 compiled with 3 warnings in 28562 ms
54
+ webpack 5.88.0 compiled with 3 warnings in 29048 ms
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-styleguide",
3
- "version": "6.1.0",
3
+ "version": "6.1.1-pre.2723",
4
4
  "license": "MPL-2.0",
5
5
  "description": "The styleguide for OpenMRS SPA",
6
6
  "browser": "dist/openmrs-esm-styleguide.js",
@@ -63,12 +63,12 @@
63
63
  "rxjs": "6.x"
64
64
  },
65
65
  "devDependencies": {
66
- "@openmrs/esm-error-handling": "6.1.0",
67
- "@openmrs/esm-extensions": "6.1.0",
68
- "@openmrs/esm-navigation": "6.1.0",
69
- "@openmrs/esm-react-utils": "6.1.0",
70
- "@openmrs/esm-state": "6.1.0",
71
- "@openmrs/esm-translations": "6.1.0",
66
+ "@openmrs/esm-error-handling": "6.1.1-pre.2723",
67
+ "@openmrs/esm-extensions": "6.1.1-pre.2723",
68
+ "@openmrs/esm-navigation": "6.1.1-pre.2723",
69
+ "@openmrs/esm-react-utils": "6.1.1-pre.2723",
70
+ "@openmrs/esm-state": "6.1.1-pre.2723",
71
+ "@openmrs/esm-translations": "6.1.1-pre.2723",
72
72
  "@types/geopattern": "^1.2.9",
73
73
  "autoprefixer": "^9.8.8",
74
74
  "css-minimizer-webpack-plugin": "^1.2.0",
@@ -81,5 +81,6 @@
81
81
  "rxjs": "^6.5.3",
82
82
  "svgo-loader": "^4.0.0",
83
83
  "webpack": "^5.88.0"
84
- }
84
+ },
85
+ "stableVersion": "6.1.0"
85
86
  }
@@ -10,6 +10,13 @@ import styles from './patient-banner-patient-info.module.scss';
10
10
 
11
11
  interface PatientBannerPatientInfoProps {
12
12
  patient: fhir.Patient;
13
+
14
+ /**
15
+ * A unique string to identify where the PatientInfo is rendered from.
16
+ * (ex: Patient Chart, search app, etc...). This string is passed into extensions to
17
+ * affect how / if they should be rendered
18
+ */
19
+ renderedFrom?: string;
13
20
  }
14
21
 
15
22
  type Gender = 'female' | 'male' | 'other' | 'unknown';
@@ -51,11 +58,14 @@ const getGender = (gender: string) => {
51
58
  };
52
59
  };
53
60
 
54
- export function PatientBannerPatientInfo({ patient }: PatientBannerPatientInfoProps) {
61
+ export function PatientBannerPatientInfo({ patient, renderedFrom }: PatientBannerPatientInfoProps) {
55
62
  const name = `${patient?.name?.[0]?.given?.join(' ')} ${patient?.name?.[0]?.family}`;
56
63
  const genderInfo = patient?.gender && getGender(patient.gender);
57
64
 
58
- const extensionState = useMemo(() => ({ patientUuid: patient.id, patient }), [patient.id, patient]);
65
+ const extensionState = useMemo(
66
+ () => ({ patientUuid: patient.id, patient, renderedFrom }),
67
+ [patient.id, patient, renderedFrom],
68
+ );
59
69
 
60
70
  return (
61
71
  <div className={styles.patientInfo}>
@@ -83,6 +93,7 @@ export function PatientBannerPatientInfo({ patient }: PatientBannerPatientInfoPr
83
93
  </>
84
94
  )}
85
95
  <PatientBannerPatientIdentifiers identifiers={patient.identifier} showIdentifierLabel />
96
+ <ExtensionSlot className={styles.extensionSlot} name="patient-banner-bottom-slot" state={extensionState} />
86
97
  </div>
87
98
  </div>
88
99
  );