@openmrs/esm-fast-data-entry-app 1.0.0-pre.11 → 1.0.0-pre.21

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.
Files changed (68) hide show
  1. package/dist/132.js +1 -0
  2. package/dist/147.js +2 -0
  3. package/dist/{502.js.LICENSE.txt → 147.js.LICENSE.txt} +0 -30
  4. package/dist/247.js +1 -0
  5. package/dist/294.js +1 -2
  6. package/dist/536.js +2 -0
  7. package/dist/{382.js.LICENSE.txt → 536.js.LICENSE.txt} +0 -0
  8. package/dist/595.js +1 -2
  9. package/dist/595.js.LICENSE.txt +2 -0
  10. package/dist/634.js +2 -0
  11. package/dist/634.js.LICENSE.txt +5 -0
  12. package/dist/776.js +1 -0
  13. package/dist/804.js +1 -0
  14. package/dist/852.js +1 -0
  15. package/dist/906.js +1 -2
  16. package/dist/935.js +2 -0
  17. package/dist/935.js.LICENSE.txt +23 -0
  18. package/dist/947.js +1 -0
  19. package/dist/openmrs-esm-fast-data-entry-app.js +1 -1
  20. package/dist/openmrs-esm-fast-data-entry-app.js.buildmanifest.json +142 -124
  21. package/dist/openmrs-esm-fast-data-entry-app.old +1 -2
  22. package/package.json +29 -33
  23. package/src/FormEntry.tsx +42 -0
  24. package/src/Loader.tsx +16 -0
  25. package/src/Root.tsx +7 -3
  26. package/src/empty-state/EmptyDataIllustration.tsx +51 -0
  27. package/src/empty-state/EmptyState.tsx +29 -0
  28. package/src/empty-state/styles.scss +55 -0
  29. package/src/forms/FormWorkflow.tsx +135 -0
  30. package/src/forms/FormsRoot.tsx +12 -10
  31. package/src/forms/FormsTable.tsx +22 -5
  32. package/src/forms/PatientCard.tsx +37 -0
  33. package/src/forms/PatientInfo.test.tsx +9 -0
  34. package/src/forms/PatientInfo.tsx +140 -0
  35. package/src/forms/patient-info.scss +59 -0
  36. package/src/forms/styles.scss +13 -0
  37. package/src/forms/useGetPatient.ts +23 -0
  38. package/src/index.ts +13 -1
  39. package/src/loader.scss +9 -0
  40. package/tsconfig.json +26 -23
  41. package/.husky/pre-commit +0 -6
  42. package/.husky/pre-push +0 -6
  43. package/dist/24.js +0 -3
  44. package/dist/24.js.LICENSE.txt +0 -16
  45. package/dist/24.js.map +0 -1
  46. package/dist/294.js.map +0 -1
  47. package/dist/296.js +0 -2
  48. package/dist/296.js.map +0 -1
  49. package/dist/299.js +0 -2
  50. package/dist/299.js.map +0 -1
  51. package/dist/382.js +0 -3
  52. package/dist/382.js.map +0 -1
  53. package/dist/415.js +0 -2
  54. package/dist/415.js.map +0 -1
  55. package/dist/502.js +0 -3
  56. package/dist/502.js.map +0 -1
  57. package/dist/595.js.map +0 -1
  58. package/dist/69.js +0 -2
  59. package/dist/69.js.map +0 -1
  60. package/dist/777.js +0 -2
  61. package/dist/777.js.map +0 -1
  62. package/dist/860.js +0 -2
  63. package/dist/860.js.map +0 -1
  64. package/dist/906.js.map +0 -1
  65. package/dist/openmrs-esm-fast-data-entry-app.js.map +0 -1
  66. package/src/patient-getter/patient-getter.resource.ts +0 -31
  67. package/src/patient-getter/patient-getter.test.tsx +0 -28
  68. package/src/patient-getter/patient-getter.tsx +0 -28
@@ -0,0 +1,59 @@
1
+ @import '~@openmrs/esm-styleguide/src/vars';
2
+ @import '~carbon-components/src/globals/scss/vars';
3
+ @import '~carbon-components/src/globals/scss/mixins';
4
+
5
+ .container {
6
+ border-bottom: 0.0125rem solid $color-gray-30;
7
+ background-color: $ui-02;
8
+ padding: 0;
9
+ }
10
+
11
+ .patientInfoContainer {
12
+ padding: 0 0 0 $spacing-05;
13
+ display: flex;
14
+ align-items: center;
15
+ min-height: 7rem;
16
+ }
17
+
18
+ .activePatientInfoContainer {
19
+ background-color: $color-blue-10;
20
+ padding: 0 0 0 $spacing-05;
21
+ display: flex;
22
+ align-items: center;
23
+ min-height: 7rem;
24
+ }
25
+
26
+ .patientName {
27
+ @include carbon--type-style('productive-heading-03');
28
+ }
29
+
30
+ .patientInfoContent {
31
+ margin: $spacing-05 0 0 $spacing-05;
32
+ width: 100%;
33
+ }
34
+
35
+ .demographics {
36
+ @include carbon--type-style('body-short-02');
37
+ color: $text-02;
38
+ margin-top: $spacing-02;
39
+ }
40
+
41
+ .identifier {
42
+ @include carbon--type-style('body-short-02');
43
+ color: $ui-04;
44
+ }
45
+
46
+ .patientInfoRow {
47
+ display: flex;
48
+ justify-content: space-between;
49
+ align-items: center;
50
+
51
+ & > button {
52
+ min-height: 2rem;
53
+ }
54
+ }
55
+
56
+ .patientEditBtn {
57
+ color: $ui-05;
58
+ margin: $spacing-03;
59
+ }
@@ -0,0 +1,13 @@
1
+ @import "~@openmrs/esm-styleguide/src/vars";
2
+
3
+ .breadcrumbsContainer > div > div > nav {
4
+ background-color: white;
5
+ padding: 0.5rem;
6
+ border-bottom: 1px solid $openmrs-background-grey;
7
+ }
8
+
9
+ .formContainer {
10
+ display: flex;
11
+ text-align: center;
12
+ margin-top: 1rem;
13
+ }
@@ -0,0 +1,23 @@
1
+ import { fetchCurrentPatient } from "@openmrs/esm-framework";
2
+ import { useEffect, useState } from "react";
3
+
4
+ const useGetPatient = (patientUuid) => {
5
+ const [patient, setPatient] = useState(null);
6
+
7
+ useEffect(() => {
8
+ if (!patientUuid) {
9
+ setPatient(null);
10
+ } else {
11
+ getPatient(patientUuid);
12
+ }
13
+ }, [patientUuid]);
14
+
15
+ const getPatient = async (uuid) => {
16
+ const result = await fetchCurrentPatient(uuid);
17
+ setPatient(result?.data);
18
+ };
19
+
20
+ return patient;
21
+ };
22
+
23
+ export default useGetPatient;
package/src/index.ts CHANGED
@@ -5,7 +5,11 @@
5
5
  * microfrontend.
6
6
  */
7
7
 
8
- import { getAsyncLifecycle, defineConfigSchema } from "@openmrs/esm-framework";
8
+ import {
9
+ getAsyncLifecycle,
10
+ defineConfigSchema,
11
+ registerBreadcrumbs,
12
+ } from "@openmrs/esm-framework";
9
13
  import { configSchema } from "./config-schema";
10
14
 
11
15
  /**
@@ -53,6 +57,14 @@ function setupOpenMRS() {
53
57
 
54
58
  defineConfigSchema(moduleName, configSchema);
55
59
 
60
+ registerBreadcrumbs([
61
+ {
62
+ path: `${window.spaBase}/forms`,
63
+ title: "Forms",
64
+ parent: `${window.spaBase}/home`,
65
+ },
66
+ ]);
67
+
56
68
  return {
57
69
  pages: [
58
70
  {
@@ -0,0 +1,9 @@
1
+ @import "~@openmrs/esm-styleguide/src/vars";
2
+ @import "~carbon-components/src/globals/scss/vars";
3
+
4
+ .loading {
5
+ display: flex;
6
+ background-color: $openmrs-background-grey;
7
+ justify-content: center;
8
+ min-height: $spacing-09;
9
+ }
package/tsconfig.json CHANGED
@@ -1,23 +1,26 @@
1
- {
2
- "compilerOptions": {
3
- "esModuleInterop": true,
4
- "module": "esnext",
5
- "allowSyntheticDefaultImports": true,
6
- "jsx": "react",
7
- "skipLibCheck": true,
8
- "moduleResolution": "node",
9
- "lib": [
10
- "dom",
11
- "es5",
12
- "scripthost",
13
- "es2015",
14
- "es2015.promise",
15
- "es2016.array.include",
16
- "es2018",
17
- "es2020"
18
- ],
19
- "resolveJsonModule": true,
20
- "noEmit": true,
21
- "target": "esnext"
22
- }
23
- }
1
+ {
2
+ "compilerOptions": {
3
+ "esModuleInterop": true,
4
+ "module": "esnext",
5
+ "allowSyntheticDefaultImports": true,
6
+ "jsx": "react",
7
+ "skipLibCheck": true,
8
+ "moduleResolution": "node",
9
+ "lib": [
10
+ "dom",
11
+ "es5",
12
+ "scripthost",
13
+ "es2015",
14
+ "es2015.promise",
15
+ "es2016.array.include",
16
+ "es2018",
17
+ "es2020"
18
+ ],
19
+ "resolveJsonModule": true,
20
+ "noEmit": true,
21
+ "target": "esnext",
22
+ // "paths": {
23
+ // "@openmrs/*": ["./node_modules/@openmrs/*"]
24
+ // }
25
+ }
26
+ }
package/.husky/pre-commit DELETED
@@ -1,6 +0,0 @@
1
- #!/bin/sh
2
- . "$(dirname "$0")/_/husky.sh"
3
-
4
- set -e # die on error
5
-
6
- npx pretty-quick --staged
package/.husky/pre-push DELETED
@@ -1,6 +0,0 @@
1
- #!/bin/sh
2
- . "$(dirname "$0")/_/husky.sh"
3
-
4
- set -e # die on error
5
-
6
- yarn verify