@openmrs/esm-form-builder-app 2.0.2-pre.563 → 2.0.2-pre.570
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/dist/150.js +1 -1
- package/dist/150.js.map +1 -1
- package/dist/153.js +1 -1
- package/dist/252.js +2 -0
- package/dist/252.js.map +1 -0
- package/dist/256.js +1 -1
- package/dist/256.js.map +1 -1
- package/dist/447.js +1 -1
- package/dist/447.js.map +1 -1
- package/dist/879.js +2 -0
- package/dist/879.js.map +1 -0
- package/dist/main.js +1 -1
- package/dist/openmrs-esm-form-builder-app.js.buildmanifest.json +198 -198
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/components/dashboard/dashboard.scss +5 -5
- package/src/components/empty-state/empty-state.scss +7 -7
- package/src/components/error-state/error-state.scss +6 -6
- package/src/components/form-editor/form-editor.component.tsx +9 -8
- package/src/components/form-editor/form-editor.scss +3 -3
- package/src/components/form-renderer/form-renderer.scss +3 -3
- package/src/components/interactive-builder/draggable-question.component.tsx +22 -23
- package/src/components/interactive-builder/draggable-question.scss +5 -9
- package/src/components/interactive-builder/edit-question-modal.component.tsx +308 -317
- package/src/components/interactive-builder/editable-value.scss +1 -1
- package/src/components/interactive-builder/interactive-builder.component.tsx +27 -29
- package/src/components/interactive-builder/interactive-builder.scss +3 -3
- package/src/components/interactive-builder/question-modal.scss +2 -2
- package/src/components/pagination/pagination.scss +4 -4
- package/src/components/schema-editor/schema-editor.scss +2 -2
- package/dist/682.js +0 -2
- package/dist/682.js.map +0 -1
- package/dist/990.js +0 -2
- package/dist/990.js.map +0 -1
- /package/dist/{682.js.LICENSE.txt → 252.js.LICENSE.txt} +0 -0
- /package/dist/{990.js.LICENSE.txt → 879.js.LICENSE.txt} +0 -0
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import React, { useCallback, useState } from "react";
|
|
2
2
|
import { useTranslation } from "react-i18next";
|
|
3
|
-
import { Accordion, AccordionItem, Button, InlineLoading } from "@carbon/react";
|
|
4
|
-
import { Add, TrashCan } from "@carbon/react/icons";
|
|
5
|
-
import { useParams } from "react-router-dom";
|
|
6
|
-
import { showToast, showNotification } from "@openmrs/esm-framework";
|
|
7
|
-
import { OHRIFormSchema } from "@openmrs/openmrs-form-engine-lib";
|
|
8
3
|
import {
|
|
9
4
|
DndContext,
|
|
10
5
|
KeyboardSensor,
|
|
@@ -12,6 +7,11 @@ import {
|
|
|
12
7
|
useSensor,
|
|
13
8
|
useSensors,
|
|
14
9
|
} from "@dnd-kit/core";
|
|
10
|
+
import { Accordion, AccordionItem, Button, InlineLoading } from "@carbon/react";
|
|
11
|
+
import { Add, TrashCan } from "@carbon/react/icons";
|
|
12
|
+
import { useParams } from "react-router-dom";
|
|
13
|
+
import { showToast, showNotification } from "@openmrs/esm-framework";
|
|
14
|
+
import { OHRIFormSchema } from "@openmrs/openmrs-form-engine-lib";
|
|
15
15
|
|
|
16
16
|
import type { Question, RouteParams, Schema } from "../../types";
|
|
17
17
|
import AddQuestionModal from "./add-question-modal.component";
|
|
@@ -279,19 +279,6 @@ const InteractiveBuilder: React.FC<InteractiveBuilderProps> = ({
|
|
|
279
279
|
setShowDeleteQuestionModal(true);
|
|
280
280
|
};
|
|
281
281
|
|
|
282
|
-
const draggable = (question: Question, section, questionIndex) => (
|
|
283
|
-
<DraggableQuestion
|
|
284
|
-
key={question.id}
|
|
285
|
-
question={question}
|
|
286
|
-
pageIndex={pageIndex}
|
|
287
|
-
sectionIndex={sectionIndex}
|
|
288
|
-
questionIndex={questionIndex}
|
|
289
|
-
duplicateQuestion={duplicateQuestion}
|
|
290
|
-
handleEditButtonClick={handleEditButtonClick}
|
|
291
|
-
handleDeleteButtonClick={handleDeleteButtonClick}
|
|
292
|
-
allQuestions={section.questions}
|
|
293
|
-
/>
|
|
294
|
-
);
|
|
295
282
|
return (
|
|
296
283
|
<div className={styles.container}>
|
|
297
284
|
{isLoading ? (
|
|
@@ -456,6 +443,7 @@ const InteractiveBuilder: React.FC<InteractiveBuilderProps> = ({
|
|
|
456
443
|
</Button>
|
|
457
444
|
</div>
|
|
458
445
|
)}
|
|
446
|
+
|
|
459
447
|
<DndContext onDragEnd={(event) => handleDragEnd(event)} sensors={sensors}>
|
|
460
448
|
{schema?.pages?.length
|
|
461
449
|
? schema.pages.map((page, pageIndex) => (
|
|
@@ -532,17 +520,27 @@ const InteractiveBuilder: React.FC<InteractiveBuilderProps> = ({
|
|
|
532
520
|
{section.questions?.length ? (
|
|
533
521
|
section.questions.map(
|
|
534
522
|
(question, questionIndex) => (
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
{
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
523
|
+
<Droppable
|
|
524
|
+
id={`droppable-question-${pageIndex}-${sectionIndex}-${questionIndex}`}
|
|
525
|
+
>
|
|
526
|
+
<DraggableQuestion
|
|
527
|
+
key={question.id}
|
|
528
|
+
question={question}
|
|
529
|
+
pageIndex={pageIndex}
|
|
530
|
+
sectionIndex={sectionIndex}
|
|
531
|
+
questionIndex={questionIndex}
|
|
532
|
+
handleDuplicateQuestion={
|
|
533
|
+
duplicateQuestion
|
|
534
|
+
}
|
|
535
|
+
handleEditButtonClick={
|
|
536
|
+
handleEditButtonClick
|
|
537
|
+
}
|
|
538
|
+
handleDeleteButtonClick={
|
|
539
|
+
handleDeleteButtonClick
|
|
540
|
+
}
|
|
541
|
+
questionCount={section.questions.length}
|
|
542
|
+
/>
|
|
543
|
+
</Droppable>
|
|
546
544
|
)
|
|
547
545
|
)
|
|
548
546
|
) : (
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
@use '@carbon/
|
|
2
|
-
@use '@carbon/
|
|
1
|
+
@use '@carbon/colors';
|
|
2
|
+
@use '@carbon/type';
|
|
3
3
|
|
|
4
4
|
.container {
|
|
5
5
|
:global(.cds--modal-content:focus) {
|
|
@@ -97,5 +97,5 @@
|
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
.addSectionButton {
|
|
100
|
-
margin: 1rem
|
|
100
|
+
margin: 1rem;
|
|
101
101
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
@use '@carbon/
|
|
2
|
-
@use '@carbon/
|
|
3
|
-
@use
|
|
1
|
+
@use '@carbon/colors';
|
|
2
|
+
@use '@carbon/layout';
|
|
3
|
+
@use "@carbon/type";
|
|
4
4
|
|
|
5
5
|
.bodyShort01 {
|
|
6
6
|
@include type.type-style("body-compact-01");
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
.configurableLink {
|
|
44
44
|
text-decoration: none;
|
|
45
45
|
@extend .bodyShort01;
|
|
46
|
-
padding: 0
|
|
46
|
+
padding: 0 layout.$spacing-03;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
.pagination {
|