@openmrs/esm-form-builder-app 2.0.2-pre.574 → 2.0.2-pre.597

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 (86) hide show
  1. package/README.md +43 -17
  2. package/dist/127.js +1 -1
  3. package/dist/127.js.map +1 -1
  4. package/dist/150.js +1 -1
  5. package/dist/150.js.map +1 -1
  6. package/dist/153.js +1 -1
  7. package/dist/153.js.map +1 -1
  8. package/dist/164.js +1 -1
  9. package/dist/256.js +1 -1
  10. package/dist/319.js +1 -1
  11. package/dist/447.js +1 -1
  12. package/dist/447.js.map +1 -1
  13. package/dist/515.js +2 -0
  14. package/dist/{773.js.LICENSE.txt → 515.js.LICENSE.txt} +9 -0
  15. package/dist/515.js.map +1 -0
  16. package/dist/527.js +1 -0
  17. package/dist/527.js.map +1 -0
  18. package/dist/574.js +1 -1
  19. package/dist/757.js +1 -1
  20. package/dist/788.js +1 -1
  21. package/dist/800.js +1 -1
  22. package/dist/800.js.map +1 -1
  23. package/dist/807.js +1 -1
  24. package/dist/833.js +1 -1
  25. package/dist/878.js +2 -0
  26. package/dist/{208.js.LICENSE.txt → 878.js.LICENSE.txt} +2 -1
  27. package/dist/878.js.map +1 -0
  28. package/dist/main.js +1 -1
  29. package/dist/main.js.map +1 -1
  30. package/dist/openmrs-esm-form-builder-app.js +1 -1
  31. package/dist/openmrs-esm-form-builder-app.js.buildmanifest.json +154 -175
  32. package/dist/openmrs-esm-form-builder-app.js.map +1 -1
  33. package/dist/routes.json +1 -1
  34. package/package.json +35 -32
  35. package/src/components/action-buttons/action-buttons.component.tsx +65 -101
  36. package/src/components/dashboard/dashboard.component.tsx +98 -174
  37. package/src/components/dashboard/dashboard.test.tsx +51 -81
  38. package/src/components/empty-state/empty-data-illustration.component.tsx +4 -16
  39. package/src/components/empty-state/empty-state.component.tsx +11 -15
  40. package/src/components/error-state/error-state.component.tsx +11 -13
  41. package/src/components/form-editor/form-editor.component.tsx +97 -128
  42. package/src/components/form-renderer/form-renderer.component.tsx +30 -41
  43. package/src/components/interactive-builder/add-question-modal.component.tsx +129 -167
  44. package/src/components/interactive-builder/delete-page-modal.component.tsx +24 -37
  45. package/src/components/interactive-builder/delete-question-modal.component.tsx +25 -47
  46. package/src/components/interactive-builder/delete-section-modal.component.tsx +24 -37
  47. package/src/components/interactive-builder/draggable-question.component.tsx +21 -34
  48. package/src/components/interactive-builder/draggable-question.scss +2 -2
  49. package/src/components/interactive-builder/droppable-container.component.tsx +5 -5
  50. package/src/components/interactive-builder/edit-question-modal.component.tsx +191 -233
  51. package/src/components/interactive-builder/editable-value.component.tsx +12 -17
  52. package/src/components/interactive-builder/interactive-builder.component.tsx +134 -184
  53. package/src/components/interactive-builder/new-form-modal.component.tsx +35 -49
  54. package/src/components/interactive-builder/page-modal.component.tsx +29 -45
  55. package/src/components/interactive-builder/question-modal.scss +7 -0
  56. package/src/components/interactive-builder/section-modal.component.tsx +29 -40
  57. package/src/components/interactive-builder/value-editor.component.tsx +11 -16
  58. package/src/components/modals/save-form-modal.component.tsx +112 -165
  59. package/src/components/pagination/index.ts +2 -2
  60. package/src/components/pagination/pagination.component.tsx +8 -13
  61. package/src/components/pagination/usePaginationInfo.ts +4 -9
  62. package/src/components/schema-editor/schema-editor.component.tsx +11 -17
  63. package/src/config-schema.ts +28 -30
  64. package/src/declarations.d.ts +4 -3
  65. package/src/form-builder-admin-card-link.component.tsx +7 -11
  66. package/src/forms.resource.ts +66 -87
  67. package/src/hooks/useClobdata.ts +10 -12
  68. package/src/hooks/useConceptLookup.ts +5 -8
  69. package/src/hooks/useConceptName.ts +6 -9
  70. package/src/hooks/useEncounterTypes.ts +8 -8
  71. package/src/hooks/useForm.ts +7 -7
  72. package/src/hooks/useForms.ts +5 -8
  73. package/src/index.ts +11 -23
  74. package/src/root.component.tsx +4 -4
  75. package/src/setup-tests.ts +1 -9
  76. package/src/test-helpers.tsx +8 -15
  77. package/src/types.ts +16 -8
  78. package/dist/208.js +0 -2
  79. package/dist/208.js.map +0 -1
  80. package/dist/536.js +0 -1
  81. package/dist/536.js.map +0 -1
  82. package/dist/62.js +0 -1
  83. package/dist/62.js.map +0 -1
  84. package/dist/773.js +0 -2
  85. package/dist/773.js.map +0 -1
  86. package/src/constants.ts +0 -3
package/src/types.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { RenderType } from "@openmrs/openmrs-form-engine-lib";
1
+ import type { RenderType } from '@openmrs/openmrs-form-engine-lib';
2
2
 
3
3
  export interface Form {
4
4
  uuid: string;
@@ -13,15 +13,10 @@ export interface Form {
13
13
  display?: string;
14
14
  }
15
15
 
16
- export type RouteParams = { formUuid: string };
17
-
18
16
  export interface FilterProps {
19
17
  rowIds: Array<string>;
20
18
  headers: Array<Record<string, string>>;
21
- cellsById: Record<
22
- string,
23
- Record<string, boolean | string | null | Record<string, unknown>>
24
- >;
19
+ cellsById: Record<string, Record<string, boolean | string | null | Record<string, unknown>>>;
25
20
  inputValue: string;
26
21
  getCellId: (row, key) => string;
27
22
  }
@@ -38,6 +33,18 @@ export interface Resource {
38
33
  valueReference: string;
39
34
  }
40
35
 
36
+ export type QuestionType =
37
+ | 'complex-obs'
38
+ | 'control'
39
+ | 'encounterDatetime'
40
+ | 'encounterLocation'
41
+ | 'encounterProvider'
42
+ | 'obs'
43
+ | 'obsGroup'
44
+ | 'personAttribute'
45
+ | 'testOrder'
46
+ | 'patientIdentifier';
47
+
41
48
  export interface Schema {
42
49
  name: string;
43
50
  pages: Array<{
@@ -48,6 +55,7 @@ export interface Schema {
48
55
  questions: Array<{
49
56
  id: string;
50
57
  label: string;
58
+ // TODO: This should be a union of all question types i.e QuestionType
51
59
  type: string;
52
60
  required?: boolean;
53
61
  questionOptions: {
@@ -93,7 +101,7 @@ export interface Question {
93
101
  type: string;
94
102
  questionOptions: QuestionOptions;
95
103
  required?: boolean;
96
- validators?: Array<Record<string, string | Array<string>>>;
104
+ validators?: Array<Record<string, string>>;
97
105
  }
98
106
 
99
107
  export interface QuestionOptions {