@awell-health/ui-library 0.1.54 → 0.1.57
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/index.css
CHANGED
package/dist/index.js
CHANGED
|
@@ -38004,8 +38004,8 @@ Check the top-level render call using <` + t + ">.");
|
|
|
38004
38004
|
};
|
|
38005
38005
|
|
|
38006
38006
|
var ConversationalForm = function (_a) {
|
|
38007
|
-
var form = _a.form,onSubmit = _a.onSubmit,buttonLabels = _a.buttonLabels,evaluateDisplayConditions = _a.evaluateDisplayConditions,errorLabels = _a.errorLabels,questionLabels = _a.questionLabels,storedAnswers = _a.storedAnswers,onAnswersChange = _a.onAnswersChange,_b = _a.autoProgress,autoProgress = _b === void 0 ? false : _b,_c = _a.autosaveAnswers,autosaveAnswers = _c === void 0 ? true : _c;
|
|
38008
|
-
var
|
|
38007
|
+
var form = _a.form,onSubmit = _a.onSubmit,buttonLabels = _a.buttonLabels,evaluateDisplayConditions = _a.evaluateDisplayConditions,errorLabels = _a.errorLabels,questionLabels = _a.questionLabels,storedAnswers = _a.storedAnswers,onAnswersChange = _a.onAnswersChange,_b = _a.autoProgress,autoProgress = _b === void 0 ? false : _b,_c = _a.autosaveAnswers,autosaveAnswers = _c === void 0 ? true : _c,_d = _a.showProgressBar,showProgressBar = _d === void 0 ? true : _d;
|
|
38008
|
+
var _e = useConversationalForm({
|
|
38009
38009
|
questions: form.questions,
|
|
38010
38010
|
onSubmit: onSubmit,
|
|
38011
38011
|
evaluateDisplayConditions: evaluateDisplayConditions,
|
|
@@ -38013,8 +38013,8 @@ Check the top-level render call using <` + t + ">.");
|
|
|
38013
38013
|
storedAnswers: storedAnswers,
|
|
38014
38014
|
autosaveAnswers: autosaveAnswers,
|
|
38015
38015
|
onAnswersChange: onAnswersChange }),
|
|
38016
|
-
submitForm =
|
|
38017
|
-
var
|
|
38016
|
+
submitForm = _e.submitForm,isSubmittingForm = _e.isSubmittingForm,handleGoToNextQuestion = _e.handleGoToNextQuestion,handleGoToPrevQuestion = _e.handleGoToPrevQuestion,_f = _e.formMethods,control = _f.control,getValues = _f.getValues,currentQuestion = _e.currentQuestion,percentageCompleted = _e.percentageCompleted,errors = _e.errors,isFirstQuestion = _e.isFirstQuestion,isLastQuestion = _e.isLastQuestion,isEvaluatingQuestionVisibility = _e.isEvaluatingQuestionVisibility;
|
|
38017
|
+
var _g = useScrollHint(),showScrollHint = _g.showScrollHint,determineShowScrollHint = _g.determineShowScrollHint;
|
|
38018
38018
|
var submitAndMoveToNextQuestion = function () {
|
|
38019
38019
|
if (!isLastQuestion) {
|
|
38020
38020
|
handleGoToNextQuestion();
|
|
@@ -38033,7 +38033,8 @@ Check the top-level render call using <` + t + ">.");
|
|
|
38033
38033
|
return false;
|
|
38034
38034
|
};
|
|
38035
38035
|
var hideProgressIndicator = isEvaluatingQuestionVisibility && percentageCompleted === 100 ||
|
|
38036
|
-
form.questions.length === 1
|
|
38036
|
+
form.questions.length === 1 ||
|
|
38037
|
+
showProgressBar === false;
|
|
38037
38038
|
return jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment, { children: [jsxRuntime.exports.jsx("main", __assign({ id: "ahp_main_content_with_scroll_hint", className: layoutClasses.main_content }, { children: jsxRuntime.exports.jsxs("div", __assign({ className: "".concat(classes$3.awell_wizard_form, " ").concat(classes$3.container) }, { children: [!hideProgressIndicator && jsxRuntime.exports.jsx("div", __assign({ className: classes$3.form_progress }, { children: jsxRuntime.exports.jsx(ProgressIndicator, { percentageCompleted: percentageCompleted }) })), isEvaluatingQuestionVisibility ||
|
|
38038
38039
|
(currentQuestion === null || currentQuestion === void 0 ? void 0 : currentQuestion.id) === undefined ? jsxRuntime.exports.jsx("div", __assign({ className: classes$3.loadingContainer }, { children: jsxRuntime.exports.jsx(LoadActivityPlaceholder, {}) })) : jsxRuntime.exports.jsx(jsxRuntime.exports.Fragment, { children: jsxRuntime.exports.jsxs("div", __assign({ className: classes$3.wizard_form }, { children: [jsxRuntime.exports.jsx(Question, { question: currentQuestion, control: control, getValues: getValues, errors: errors, labels: questionLabels, submitAndMoveToNextQuestion: submitAndMoveToNextQuestion, inputAutoFocus: true, shouldAutoProgress: shouldAutoProgress }, currentQuestion.id), (form === null || form === void 0 ? void 0 : form.trademark) && jsxRuntime.exports.jsx("div", __assign({ className: "".concat(classes$3.trademark, " ").concat(classes$3.conversational) }, { children: form.trademark }))] })) })] })) })), jsxRuntime.exports.jsx(HostedPageFooter, __assign({ showScrollHint: showScrollHint }, { children: !isEvaluatingQuestionVisibility && jsxRuntime.exports.jsxs("div", __assign({ className: "".concat(classes$3.conversational_button_wrapper, " ").concat(classes$3.container) }, { children: [jsxRuntime.exports.jsx("div", { children: !isFirstQuestion && jsxRuntime.exports.jsx(Button, __assign({ variant: "tertiary", onClick: handleGoToPrevQuestion, "data-cy": "navigateToPrevQuestionButton" }, { children: buttonLabels.prev })) }), isLastQuestion ? jsxRuntime.exports.jsx(Button, __assign({ onClick: submitForm, type: "submit", "data-cy": "submitFormButton", disabled: isSubmittingForm }, { children: buttonLabels.submit })) : jsxRuntime.exports.jsx(Button, __assign({ variant: "secondary", onClick: handleGoToNextQuestion, "data-cy": "navigateToNextQuestionButton" }, { children: buttonLabels.next }))] })) }))] });
|
|
38039
38040
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { FormProps } from '../../../types/form';
|
|
3
|
-
export declare const ConversationalForm: ({ form, onSubmit, buttonLabels, evaluateDisplayConditions, errorLabels, questionLabels, storedAnswers, onAnswersChange, autoProgress, autosaveAnswers, }: FormProps) => JSX.Element;
|
|
3
|
+
export declare const ConversationalForm: ({ form, onSubmit, buttonLabels, evaluateDisplayConditions, errorLabels, questionLabels, storedAnswers, onAnswersChange, autoProgress, autosaveAnswers, showProgressBar, }: FormProps) => JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const WizardForm: ({ form, onSubmit, buttonLabels, evaluateDisplayConditions, errorLabels, questionLabels, storedAnswers, onAnswersChange, autoProgress, autosaveAnswers, }: import("../../..").FormProps) => JSX.Element;
|
|
2
|
+
export declare const WizardForm: ({ form, onSubmit, buttonLabels, evaluateDisplayConditions, errorLabels, questionLabels, storedAnswers, onAnswersChange, autoProgress, autosaveAnswers, showProgressBar, }: import("../../..").FormProps) => JSX.Element;
|