@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.
- package/README.md +43 -17
- package/dist/127.js +1 -1
- package/dist/127.js.map +1 -1
- package/dist/150.js +1 -1
- package/dist/150.js.map +1 -1
- package/dist/153.js +1 -1
- package/dist/153.js.map +1 -1
- package/dist/164.js +1 -1
- package/dist/256.js +1 -1
- package/dist/319.js +1 -1
- package/dist/447.js +1 -1
- package/dist/447.js.map +1 -1
- package/dist/515.js +2 -0
- package/dist/{773.js.LICENSE.txt → 515.js.LICENSE.txt} +9 -0
- package/dist/515.js.map +1 -0
- package/dist/527.js +1 -0
- package/dist/527.js.map +1 -0
- package/dist/574.js +1 -1
- package/dist/757.js +1 -1
- package/dist/788.js +1 -1
- package/dist/800.js +1 -1
- package/dist/800.js.map +1 -1
- package/dist/807.js +1 -1
- package/dist/833.js +1 -1
- package/dist/878.js +2 -0
- package/dist/{208.js.LICENSE.txt → 878.js.LICENSE.txt} +2 -1
- package/dist/878.js.map +1 -0
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/openmrs-esm-form-builder-app.js +1 -1
- package/dist/openmrs-esm-form-builder-app.js.buildmanifest.json +154 -175
- package/dist/openmrs-esm-form-builder-app.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +35 -32
- package/src/components/action-buttons/action-buttons.component.tsx +65 -101
- package/src/components/dashboard/dashboard.component.tsx +98 -174
- package/src/components/dashboard/dashboard.test.tsx +51 -81
- package/src/components/empty-state/empty-data-illustration.component.tsx +4 -16
- package/src/components/empty-state/empty-state.component.tsx +11 -15
- package/src/components/error-state/error-state.component.tsx +11 -13
- package/src/components/form-editor/form-editor.component.tsx +97 -128
- package/src/components/form-renderer/form-renderer.component.tsx +30 -41
- package/src/components/interactive-builder/add-question-modal.component.tsx +129 -167
- package/src/components/interactive-builder/delete-page-modal.component.tsx +24 -37
- package/src/components/interactive-builder/delete-question-modal.component.tsx +25 -47
- package/src/components/interactive-builder/delete-section-modal.component.tsx +24 -37
- package/src/components/interactive-builder/draggable-question.component.tsx +21 -34
- package/src/components/interactive-builder/draggable-question.scss +2 -2
- package/src/components/interactive-builder/droppable-container.component.tsx +5 -5
- package/src/components/interactive-builder/edit-question-modal.component.tsx +191 -233
- package/src/components/interactive-builder/editable-value.component.tsx +12 -17
- package/src/components/interactive-builder/interactive-builder.component.tsx +134 -184
- package/src/components/interactive-builder/new-form-modal.component.tsx +35 -49
- package/src/components/interactive-builder/page-modal.component.tsx +29 -45
- package/src/components/interactive-builder/question-modal.scss +7 -0
- package/src/components/interactive-builder/section-modal.component.tsx +29 -40
- package/src/components/interactive-builder/value-editor.component.tsx +11 -16
- package/src/components/modals/save-form-modal.component.tsx +112 -165
- package/src/components/pagination/index.ts +2 -2
- package/src/components/pagination/pagination.component.tsx +8 -13
- package/src/components/pagination/usePaginationInfo.ts +4 -9
- package/src/components/schema-editor/schema-editor.component.tsx +11 -17
- package/src/config-schema.ts +28 -30
- package/src/declarations.d.ts +4 -3
- package/src/form-builder-admin-card-link.component.tsx +7 -11
- package/src/forms.resource.ts +66 -87
- package/src/hooks/useClobdata.ts +10 -12
- package/src/hooks/useConceptLookup.ts +5 -8
- package/src/hooks/useConceptName.ts +6 -9
- package/src/hooks/useEncounterTypes.ts +8 -8
- package/src/hooks/useForm.ts +7 -7
- package/src/hooks/useForms.ts +5 -8
- package/src/index.ts +11 -23
- package/src/root.component.tsx +4 -4
- package/src/setup-tests.ts +1 -9
- package/src/test-helpers.tsx +8 -15
- package/src/types.ts +16 -8
- package/dist/208.js +0 -2
- package/dist/208.js.map +0 -1
- package/dist/536.js +0 -1
- package/dist/536.js.map +0 -1
- package/dist/62.js +0 -1
- package/dist/62.js.map +0 -1
- package/dist/773.js +0 -2
- package/dist/773.js.map +0 -1
- package/src/constants.ts +0 -3
package/src/types.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RenderType } from
|
|
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
|
|
104
|
+
validators?: Array<Record<string, string>>;
|
|
97
105
|
}
|
|
98
106
|
|
|
99
107
|
export interface QuestionOptions {
|