analytica-frontend-lib 1.1.83 → 1.1.85
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/Quiz/index.d.mts +1 -0
- package/dist/Quiz/index.d.ts +1 -0
- package/dist/Quiz/index.js +103 -82
- package/dist/Quiz/index.js.map +1 -1
- package/dist/Quiz/index.mjs +103 -82
- package/dist/Quiz/index.mjs.map +1 -1
- package/dist/index.js +103 -82
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +103 -82
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -11506,80 +11506,83 @@ var Quiz = forwardRef21(({ children, className, variant = "default", ...props },
|
|
|
11506
11506
|
}, [variant, setVariant]);
|
|
11507
11507
|
return /* @__PURE__ */ jsx51("div", { ref, className: cn("flex flex-col", className), ...props, children });
|
|
11508
11508
|
});
|
|
11509
|
-
var QuizTitle = forwardRef21(
|
|
11510
|
-
|
|
11511
|
-
|
|
11512
|
-
|
|
11513
|
-
|
|
11514
|
-
|
|
11515
|
-
|
|
11516
|
-
|
|
11517
|
-
|
|
11518
|
-
|
|
11519
|
-
|
|
11520
|
-
|
|
11521
|
-
|
|
11522
|
-
|
|
11523
|
-
|
|
11524
|
-
|
|
11525
|
-
|
|
11526
|
-
|
|
11527
|
-
|
|
11528
|
-
|
|
11529
|
-
|
|
11530
|
-
|
|
11531
|
-
|
|
11509
|
+
var QuizTitle = forwardRef21(({ className, onBack, ...props }, ref) => {
|
|
11510
|
+
const {
|
|
11511
|
+
quiz,
|
|
11512
|
+
currentQuestionIndex,
|
|
11513
|
+
getTotalQuestions,
|
|
11514
|
+
getQuizTitle,
|
|
11515
|
+
timeElapsed,
|
|
11516
|
+
formatTime: formatTime2,
|
|
11517
|
+
isStarted
|
|
11518
|
+
} = useQuizStore();
|
|
11519
|
+
const [showExitConfirmation, setShowExitConfirmation] = useState21(false);
|
|
11520
|
+
const totalQuestions = getTotalQuestions();
|
|
11521
|
+
const quizTitle = getQuizTitle();
|
|
11522
|
+
const handleBackClick = () => {
|
|
11523
|
+
if (isStarted) {
|
|
11524
|
+
setShowExitConfirmation(true);
|
|
11525
|
+
} else {
|
|
11526
|
+
actionOnBack();
|
|
11527
|
+
}
|
|
11528
|
+
};
|
|
11529
|
+
const handleConfirmExit = () => {
|
|
11530
|
+
setShowExitConfirmation(false);
|
|
11531
|
+
actionOnBack();
|
|
11532
|
+
};
|
|
11533
|
+
const actionOnBack = () => {
|
|
11534
|
+
if (onBack) {
|
|
11535
|
+
onBack();
|
|
11536
|
+
} else {
|
|
11532
11537
|
window.history.back();
|
|
11533
|
-
}
|
|
11534
|
-
|
|
11535
|
-
|
|
11536
|
-
|
|
11537
|
-
|
|
11538
|
-
|
|
11539
|
-
|
|
11540
|
-
|
|
11541
|
-
|
|
11542
|
-
|
|
11543
|
-
|
|
11544
|
-
|
|
11545
|
-
|
|
11546
|
-
|
|
11547
|
-
|
|
11548
|
-
|
|
11549
|
-
|
|
11550
|
-
|
|
11551
|
-
|
|
11552
|
-
|
|
11553
|
-
|
|
11554
|
-
|
|
11555
|
-
|
|
11556
|
-
|
|
11557
|
-
/* @__PURE__ */ jsxs37("span", { className: "flex flex-col gap-2 text-center", children: [
|
|
11558
|
-
/* @__PURE__ */ jsx51("p", { className: "text-text-950 font-bold text-md", children: quizTitle }),
|
|
11559
|
-
/* @__PURE__ */ jsx51("p", { className: "text-text-600 text-xs", children: totalQuestions > 0 ? `${currentQuestionIndex + 1} de ${totalQuestions}` : "0 de 0" })
|
|
11560
|
-
] }),
|
|
11561
|
-
/* @__PURE__ */ jsx51("span", { className: "flex flex-row items-center justify-center", children: /* @__PURE__ */ jsx51(Badge_default, { variant: "outlined", action: "info", iconLeft: /* @__PURE__ */ jsx51(Clock2, {}), children: isStarted ? formatTime2(timeElapsed) : "00:00" }) })
|
|
11562
|
-
]
|
|
11563
|
-
}
|
|
11564
|
-
),
|
|
11565
|
-
/* @__PURE__ */ jsx51(
|
|
11566
|
-
AlertDialog,
|
|
11567
|
-
{
|
|
11568
|
-
isOpen: showExitConfirmation,
|
|
11569
|
-
onChangeOpen: setShowExitConfirmation,
|
|
11570
|
-
title: "Deseja sair?",
|
|
11571
|
-
description: getExitConfirmationText(
|
|
11572
|
-
quiz?.type || "SIMULADO" /* SIMULADO */
|
|
11538
|
+
}
|
|
11539
|
+
};
|
|
11540
|
+
const handleCancelExit = () => {
|
|
11541
|
+
setShowExitConfirmation(false);
|
|
11542
|
+
};
|
|
11543
|
+
return /* @__PURE__ */ jsxs37(Fragment12, { children: [
|
|
11544
|
+
/* @__PURE__ */ jsxs37(
|
|
11545
|
+
"div",
|
|
11546
|
+
{
|
|
11547
|
+
ref,
|
|
11548
|
+
className: cn(
|
|
11549
|
+
"flex flex-row justify-between items-center relative p-2",
|
|
11550
|
+
className
|
|
11551
|
+
),
|
|
11552
|
+
...props,
|
|
11553
|
+
children: [
|
|
11554
|
+
/* @__PURE__ */ jsx51(
|
|
11555
|
+
IconButton_default,
|
|
11556
|
+
{
|
|
11557
|
+
icon: /* @__PURE__ */ jsx51(CaretLeft2, { size: 24 }),
|
|
11558
|
+
size: "md",
|
|
11559
|
+
"aria-label": "Voltar",
|
|
11560
|
+
onClick: handleBackClick
|
|
11561
|
+
}
|
|
11573
11562
|
),
|
|
11574
|
-
|
|
11575
|
-
|
|
11576
|
-
|
|
11577
|
-
|
|
11578
|
-
|
|
11579
|
-
|
|
11580
|
-
|
|
11581
|
-
|
|
11582
|
-
|
|
11563
|
+
/* @__PURE__ */ jsxs37("span", { className: "flex flex-col gap-2 text-center", children: [
|
|
11564
|
+
/* @__PURE__ */ jsx51("p", { className: "text-text-950 font-bold text-md", children: quizTitle }),
|
|
11565
|
+
/* @__PURE__ */ jsx51("p", { className: "text-text-600 text-xs", children: totalQuestions > 0 ? `${currentQuestionIndex + 1} de ${totalQuestions}` : "0 de 0" })
|
|
11566
|
+
] }),
|
|
11567
|
+
/* @__PURE__ */ jsx51("span", { className: "flex flex-row items-center justify-center", children: /* @__PURE__ */ jsx51(Badge_default, { variant: "outlined", action: "info", iconLeft: /* @__PURE__ */ jsx51(Clock2, {}), children: isStarted ? formatTime2(timeElapsed) : "00:00" }) })
|
|
11568
|
+
]
|
|
11569
|
+
}
|
|
11570
|
+
),
|
|
11571
|
+
/* @__PURE__ */ jsx51(
|
|
11572
|
+
AlertDialog,
|
|
11573
|
+
{
|
|
11574
|
+
isOpen: showExitConfirmation,
|
|
11575
|
+
onChangeOpen: setShowExitConfirmation,
|
|
11576
|
+
title: "Deseja sair?",
|
|
11577
|
+
description: getExitConfirmationText(quiz?.type || "SIMULADO" /* SIMULADO */),
|
|
11578
|
+
cancelButtonLabel: "Voltar e revisar",
|
|
11579
|
+
submitButtonLabel: "Sair Mesmo Assim",
|
|
11580
|
+
onSubmit: handleConfirmExit,
|
|
11581
|
+
onCancel: handleCancelExit
|
|
11582
|
+
}
|
|
11583
|
+
)
|
|
11584
|
+
] });
|
|
11585
|
+
});
|
|
11583
11586
|
var QuizHeader = () => {
|
|
11584
11587
|
const { getCurrentQuestion, currentQuestionIndex } = useQuizStore();
|
|
11585
11588
|
const currentQuestion = getCurrentQuestion();
|
|
@@ -11850,16 +11853,34 @@ var QuizFooter = forwardRef21(
|
|
|
11850
11853
|
children: "Avan\xE7ar"
|
|
11851
11854
|
}
|
|
11852
11855
|
)
|
|
11853
|
-
] }) : /* @__PURE__ */
|
|
11854
|
-
|
|
11855
|
-
|
|
11856
|
-
|
|
11857
|
-
|
|
11858
|
-
|
|
11859
|
-
|
|
11860
|
-
|
|
11861
|
-
|
|
11862
|
-
|
|
11856
|
+
] }) : /* @__PURE__ */ jsxs37("div", { className: "flex flex-row items-center justify-between w-full", children: [
|
|
11857
|
+
/* @__PURE__ */ jsx51("span", { children: quiz?.canRetry && /* @__PURE__ */ jsx51(
|
|
11858
|
+
Button_default,
|
|
11859
|
+
{
|
|
11860
|
+
variant: "link",
|
|
11861
|
+
action: "primary",
|
|
11862
|
+
size: "medium",
|
|
11863
|
+
onClick: () => openModal("modalResolution"),
|
|
11864
|
+
children: "Ver Resolu\xE7\xE3o"
|
|
11865
|
+
}
|
|
11866
|
+
) }),
|
|
11867
|
+
/* @__PURE__ */ jsx51(
|
|
11868
|
+
Button_default,
|
|
11869
|
+
{
|
|
11870
|
+
variant: "solid",
|
|
11871
|
+
action: "primary",
|
|
11872
|
+
size: "medium",
|
|
11873
|
+
onClick: () => {
|
|
11874
|
+
if (quiz?.canRetry) {
|
|
11875
|
+
onRepeat?.();
|
|
11876
|
+
} else {
|
|
11877
|
+
openModal("modalResolution");
|
|
11878
|
+
}
|
|
11879
|
+
},
|
|
11880
|
+
children: quiz?.canRetry ? `Repetir ${getTypeLabel(quiz.type)}` : "Ver Resolu\xE7\xE3o"
|
|
11881
|
+
}
|
|
11882
|
+
)
|
|
11883
|
+
] })
|
|
11863
11884
|
}
|
|
11864
11885
|
),
|
|
11865
11886
|
/* @__PURE__ */ jsx51(
|