@awell-health/ui-library 0.1.139 → 0.1.141
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 +9 -1
- package/dist/index.js +65 -7
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -8253,12 +8253,20 @@ html {
|
|
|
8253
8253
|
justify-content: space-between;
|
|
8254
8254
|
align-items: center;
|
|
8255
8255
|
width: 100%;
|
|
8256
|
-
padding-bottom: var(--awell-spacing-6);
|
|
8257
8256
|
max-width: var(--awell-activity-form-max-width);
|
|
8258
8257
|
padding: var(--awell-activity-form-padding);
|
|
8259
8258
|
margin: 0 auto;
|
|
8260
8259
|
}
|
|
8261
8260
|
|
|
8261
|
+
.awell__form_traditional_form {
|
|
8262
|
+
padding-bottom: calc(var(--awell-mobile-footer-height) + var(--awell-spacing-24));
|
|
8263
|
+
}
|
|
8264
|
+
@media (min-width: 640px) {
|
|
8265
|
+
.awell__form_traditional_form {
|
|
8266
|
+
padding-bottom: calc(var(--awell-footer-height) + var(--awell-spacing-24));
|
|
8267
|
+
}
|
|
8268
|
+
}
|
|
8269
|
+
|
|
8262
8270
|
.awell__form_traditional_form_question {
|
|
8263
8271
|
margin-bottom: var(--awell-spacing-8);
|
|
8264
8272
|
}
|
package/dist/index.js
CHANGED
|
@@ -51877,7 +51877,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
51877
51877
|
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("article", __assign({ className: "".concat(classes$5.awell_message, " ").concat(classes$5.container) }, { children: [jsxRuntime.exports.jsx("div", __assign({ className: classes$5.message_title }, { children: subject })), jsxRuntime.exports.jsx("div", __assign({ className: classes$5.content }, { children: jsxRuntime.exports.jsx(RichTextViewer, { content: cleanContent }) })), jsxRuntime.exports.jsxs("div", __assign({ className: classes$5.attachmentList }, { children: [jsxRuntime.exports.jsx(AttachmentList, { attachments: attachments, icon: attachmentIcon, labels: attachmentLabels }), children] }))] })) })), jsxRuntime.exports.jsx(HostedPageFooter, { children: jsxRuntime.exports.jsx("div", __assign({ className: "".concat(classes$5.button_wrapper, " ").concat(classes$5.container) }, { children: jsxRuntime.exports.jsx(Button, __assign({ "data-cy": "markMessageAsReadButton", variant: "secondary", onClick: onMessageRead }, { children: buttonLabels.readMessage })) })) })] });
|
|
51878
51878
|
};
|
|
51879
51879
|
|
|
51880
|
-
var classes$4 = {"container":"awell__form_container","traditional_container":"awell__form_traditional_container","awell_wizard_form":"awell__form_awell_wizard_form","form_progress":"awell__form_form_progress","loadingContainer":"awell__form_loadingContainer","title":"awell__form_title","wizard_form":"awell__form_wizard_form","conversational_button_wrapper":"awell__form_conversational_button_wrapper","traditional_button_wrapper":"awell__form_traditional_button_wrapper","traditional_form_question":"awell__form_traditional_form_question","trademark":"awell__form_trademark","conversational":"awell__form_conversational"};
|
|
51880
|
+
var classes$4 = {"container":"awell__form_container","traditional_container":"awell__form_traditional_container","awell_wizard_form":"awell__form_awell_wizard_form","form_progress":"awell__form_form_progress","loadingContainer":"awell__form_loadingContainer","title":"awell__form_title","wizard_form":"awell__form_wizard_form","conversational_button_wrapper":"awell__form_conversational_button_wrapper","traditional_button_wrapper":"awell__form_traditional_button_wrapper","traditional_form":"awell__form_traditional_form","traditional_form_question":"awell__form_traditional_form_question","trademark":"awell__form_trademark","conversational":"awell__form_conversational"};
|
|
51881
51881
|
|
|
51882
51882
|
var useClickOutsideNotifier = function (_a) {
|
|
51883
51883
|
var ref = _a.ref,clickOutsideHandler = _a.clickOutsideHandler;
|
|
@@ -52373,15 +52373,44 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
52373
52373
|
var _f = React.useState(false),isSubmittingForm = _f[0],setIsSubmittingForm = _f[1];
|
|
52374
52374
|
var _g = useValidate(),isValidE164Number = _g.isValidE164Number,validateDateResponse = _g.validateDateResponse,validateNumberResponse = _g.validateNumberResponse,validateEmailResponse = _g.validateEmailResponse,validateAttachmentsResponse = _g.validateAttachmentsResponse,validateInputValidationResponse = _g.validateInputValidationResponse;
|
|
52375
52375
|
var updateQuestionVisibility = React.useCallback(function () {return __awaiter(void 0, void 0, void 0, function () {
|
|
52376
|
-
var formValuesInput, evaluationResults, updatedQuestions;
|
|
52376
|
+
var questionsWithVisibility, attempt, formValuesInput, evaluationResults, didResetHiddenAnswer, updatedQuestions;
|
|
52377
52377
|
return __generator(this, function (_a) {
|
|
52378
52378
|
switch (_a.label) {
|
|
52379
52379
|
case 0:
|
|
52380
|
+
questionsWithVisibility = [];
|
|
52381
|
+
attempt = 0;
|
|
52382
|
+
_a.label = 1;
|
|
52383
|
+
case 1:
|
|
52384
|
+
if (!(attempt <= questions.length)) return [3, 4];
|
|
52380
52385
|
formValuesInput = convertToAwellInput(getDirtyFieldValues(formMethods));
|
|
52381
52386
|
return [4, evaluateDisplayConditions(formValuesInput)];
|
|
52382
|
-
case
|
|
52387
|
+
case 2:
|
|
52383
52388
|
evaluationResults = _a.sent();
|
|
52384
|
-
|
|
52389
|
+
questionsWithVisibility = updateVisibilityForTraditionalForm(questions, evaluationResults);
|
|
52390
|
+
didResetHiddenAnswer = questionsWithVisibility.
|
|
52391
|
+
filter(function (question) {return !question.visible;}).
|
|
52392
|
+
reduce(function (didReset, question) {
|
|
52393
|
+
var defaultValue = getDefaultValue(question);
|
|
52394
|
+
var currentValue = formMethods.getValues(question.id);
|
|
52395
|
+
var fieldState = formMethods.getFieldState(question.id);
|
|
52396
|
+
var hasNonDefaultValue = JSON.stringify(currentValue) !== JSON.stringify(defaultValue);
|
|
52397
|
+
if (!fieldState.isDirty &&
|
|
52398
|
+
!fieldState.isTouched &&
|
|
52399
|
+
!hasNonDefaultValue) {
|
|
52400
|
+
return didReset;
|
|
52401
|
+
}
|
|
52402
|
+
formMethods.resetField(question.id, { defaultValue: defaultValue });
|
|
52403
|
+
return true;
|
|
52404
|
+
}, false);
|
|
52405
|
+
if (!didResetHiddenAnswer) {
|
|
52406
|
+
return [3, 4];
|
|
52407
|
+
}
|
|
52408
|
+
_a.label = 3;
|
|
52409
|
+
case 3:
|
|
52410
|
+
attempt += 1;
|
|
52411
|
+
return [3, 1];
|
|
52412
|
+
case 4:
|
|
52413
|
+
updatedQuestions = questionsWithVisibility.filter(function (e) {return e.visible;});
|
|
52385
52414
|
setVisibleQuestions(updatedQuestions);
|
|
52386
52415
|
return [2, updatedQuestions];}
|
|
52387
52416
|
|
|
@@ -52509,16 +52538,45 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
52509
52538
|
var _h = React.useState(0),percentageCompleted = _h[0],setPercentageCompleted = _h[1];
|
|
52510
52539
|
var _j = React.useState(false),isSubmittingForm = _j[0],setIsSubmittingForm = _j[1];
|
|
52511
52540
|
var updateQuestionVisibility = React.useCallback(function () {return __awaiter(void 0, void 0, void 0, function () {
|
|
52512
|
-
var formValuesInput, evaluationResults, updatedQuestions;
|
|
52541
|
+
var questionsWithVisibility, attempt, formValuesInput, evaluationResults, didResetHiddenAnswer, updatedQuestions;
|
|
52513
52542
|
return __generator(this, function (_a) {
|
|
52514
52543
|
switch (_a.label) {
|
|
52515
52544
|
case 0:
|
|
52516
52545
|
setIsEvaluatingQuestionVisibility(true);
|
|
52546
|
+
questionsWithVisibility = [];
|
|
52547
|
+
attempt = 0;
|
|
52548
|
+
_a.label = 1;
|
|
52549
|
+
case 1:
|
|
52550
|
+
if (!(attempt <= questions.length)) return [3, 4];
|
|
52517
52551
|
formValuesInput = convertToAwellInput(getDirtyFieldValues(formMethods));
|
|
52518
52552
|
return [4, evaluateDisplayConditions(formValuesInput)];
|
|
52519
|
-
case
|
|
52553
|
+
case 2:
|
|
52520
52554
|
evaluationResults = _a.sent();
|
|
52521
|
-
|
|
52555
|
+
questionsWithVisibility = updateVisibility(questions, evaluationResults);
|
|
52556
|
+
didResetHiddenAnswer = questionsWithVisibility.
|
|
52557
|
+
filter(function (question) {return !question.visible;}).
|
|
52558
|
+
reduce(function (didReset, question) {
|
|
52559
|
+
var defaultValue = getDefaultValue(question);
|
|
52560
|
+
var currentValue = formMethods.getValues(question.id);
|
|
52561
|
+
var fieldState = formMethods.getFieldState(question.id);
|
|
52562
|
+
var hasNonDefaultValue = JSON.stringify(currentValue) !== JSON.stringify(defaultValue);
|
|
52563
|
+
if (!fieldState.isDirty &&
|
|
52564
|
+
!fieldState.isTouched &&
|
|
52565
|
+
!hasNonDefaultValue) {
|
|
52566
|
+
return didReset;
|
|
52567
|
+
}
|
|
52568
|
+
formMethods.resetField(question.id, { defaultValue: defaultValue });
|
|
52569
|
+
return true;
|
|
52570
|
+
}, false);
|
|
52571
|
+
if (!didResetHiddenAnswer) {
|
|
52572
|
+
return [3, 4];
|
|
52573
|
+
}
|
|
52574
|
+
_a.label = 3;
|
|
52575
|
+
case 3:
|
|
52576
|
+
attempt += 1;
|
|
52577
|
+
return [3, 1];
|
|
52578
|
+
case 4:
|
|
52579
|
+
updatedQuestions = questionsWithVisibility.filter(function (e) {return e.visible;});
|
|
52522
52580
|
setVisibleQuestions(updatedQuestions);
|
|
52523
52581
|
setIsEvaluatingQuestionVisibility(false);
|
|
52524
52582
|
return [2, updatedQuestions];}
|