@awell-health/ui-library 0.1.114 → 0.1.115

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.js CHANGED
@@ -48924,6 +48924,21 @@ var Kr=[{
48924
48924
  return __assign(__assign({}, question), { visible: visible });
48925
48925
  });
48926
48926
  };
48927
+ var updateVisibilityForTraditionalForm = function (questions, evaluation_results) {
48928
+ if (evaluation_results.length === 0) {
48929
+ return questions.map(function (question) {return __assign(__assign({}, question), { visible: question.rule === null });});
48930
+ } else
48931
+ {
48932
+ return questions.map(function (question) {
48933
+ var result = evaluation_results.find(function (_a) {
48934
+ var question_id = _a.question_id;
48935
+ return question_id === question.id;
48936
+ });
48937
+ var visible = !result ? true : result === null || result === void 0 ? void 0 : result.satisfied;
48938
+ return __assign(__assign({}, question), { visible: visible });
48939
+ });
48940
+ }
48941
+ };
48927
48942
  var isEmpty = function (value) {
48928
48943
  return typeof Array.isArray(value) && value.length === 0 ||
48929
48944
  typeof value === 'string' && value.length === 0 ||
@@ -49104,7 +49119,7 @@ var Kr=[{
49104
49119
  return [4, evaluateDisplayConditions(formValuesInput)];
49105
49120
  case 1:
49106
49121
  evaluationResults = _a.sent();
49107
- updatedQuestions = updateVisibility(questions, evaluationResults).filter(function (e) {return e.visible;});
49122
+ updatedQuestions = updateVisibilityForTraditionalForm(questions, evaluationResults).filter(function (e) {return e.visible;});
49108
49123
  setVisibleQuestions(updatedQuestions);
49109
49124
  return [2, updatedQuestions];}
49110
49125
 
@@ -12,6 +12,7 @@ export declare const convertToAwellInput: (formResponse: any) => {
12
12
  }[];
13
13
  export declare const convertToFormFormat: (answersAsString: string | undefined, questions: Array<Question>) => Record<string, AnswerValue>;
14
14
  export declare const updateVisibility: (questions: Array<Question>, evaluation_results: Array<QuestionRuleResult>) => Array<QuestionWithVisibility>;
15
+ export declare const updateVisibilityForTraditionalForm: (questions: Array<Question>, evaluation_results: Array<QuestionRuleResult>) => Array<QuestionWithVisibility>;
15
16
  export declare const isEmpty: (value: any) => boolean;
16
17
  interface CalculatePercentageCompletedProps {
17
18
  currentQuestionId: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awell-health/ui-library",
3
- "version": "0.1.114",
3
+ "version": "0.1.115",
4
4
  "description": "UI components to integrate with Awell Health",
5
5
  "repository": {
6
6
  "type": "git",