@openmrs/esm-form-builder-app 2.0.2-pre.559 → 2.0.2-pre.568
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.component.tsx +0 -1
- package/src/components/form-editor/form-editor.component.tsx +48 -5
- package/src/components/form-editor/form-editor.scss +6 -0
- package/src/components/interactive-builder/draggable-question.component.tsx +23 -24
- package/src/components/interactive-builder/edit-question-modal.component.tsx +308 -317
- package/src/components/interactive-builder/editable-value.component.tsx +1 -1
- package/src/components/interactive-builder/interactive-builder.component.tsx +29 -31
- 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) => (
|
|
@@ -471,7 +459,7 @@ const InteractiveBuilder: React.FC<InteractiveBuilderProps> = ({
|
|
|
471
459
|
</div>
|
|
472
460
|
<Button
|
|
473
461
|
hasIconOnly
|
|
474
|
-
enterDelayMs={
|
|
462
|
+
enterDelayMs={300}
|
|
475
463
|
iconDescription={t("deletePage", "Delete page")}
|
|
476
464
|
kind="ghost"
|
|
477
465
|
onClick={() => {
|
|
@@ -511,7 +499,7 @@ const InteractiveBuilder: React.FC<InteractiveBuilderProps> = ({
|
|
|
511
499
|
</div>
|
|
512
500
|
<Button
|
|
513
501
|
hasIconOnly
|
|
514
|
-
enterDelayMs={
|
|
502
|
+
enterDelayMs={300}
|
|
515
503
|
iconDescription={t(
|
|
516
504
|
"deleteSection",
|
|
517
505
|
"Delete section"
|
|
@@ -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
|
) : (
|