@eric-emg/symphiq-components 1.2.445 → 1.2.447

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.
@@ -89175,6 +89175,10 @@ class ProfileQuestionCardComponent {
89175
89175
  return [...current, ...uniqueRemoved];
89176
89176
  }, ...(ngDevMode ? [{ debugName: "displayAnswers" }] : []));
89177
89177
  this.isAnswered = computed(() => {
89178
+ const q = this.question();
89179
+ if ('answered' in q && typeof q.answered === 'boolean') {
89180
+ return q.answered;
89181
+ }
89178
89182
  return this.questionAnswers().length > 0;
89179
89183
  }, ...(ngDevMode ? [{ debugName: "isAnswered" }] : []));
89180
89184
  this.relatedFocusAreas = computed(() => {
@@ -90167,6 +90171,12 @@ function ProfileQuestionsModalComponent_Conditional_0_Template(rf, ctx) { if (rf
90167
90171
  i0.ɵɵconditional(ctx_r1.historyModeActive() ? 8 : !ctx_r1.answerModeActive() ? 9 : 10);
90168
90172
  } }
90169
90173
  class ProfileQuestionsModalComponent {
90174
+ isQuestionAnswered(q, answers) {
90175
+ if ('answered' in q && typeof q.answered === 'boolean') {
90176
+ return q.answered;
90177
+ }
90178
+ return answers.some(a => a.profileQuestionId === q.id);
90179
+ }
90170
90180
  constructor() {
90171
90181
  this.isOpen = input(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : []));
90172
90182
  this.questions = input([], ...(ngDevMode ? [{ debugName: "questions" }] : []));
@@ -90248,7 +90258,7 @@ class ProfileQuestionsModalComponent {
90248
90258
  }, ...(ngDevMode ? [{ debugName: "filteredQuestions" }] : []));
90249
90259
  this.answeredCount = computed(() => {
90250
90260
  const answers = this.profileAnswers();
90251
- return this.filteredQuestions().filter(q => answers.some(a => a.profileQuestionId === q.id)).length;
90261
+ return this.filteredQuestions().filter(q => this.isQuestionAnswered(q, answers)).length;
90252
90262
  }, ...(ngDevMode ? [{ debugName: "answeredCount" }] : []));
90253
90263
  this.totalCount = computed(() => {
90254
90264
  return this.filteredQuestions().length;
@@ -90268,8 +90278,7 @@ class ProfileQuestionsModalComponent {
90268
90278
  this.modalReady.set(true);
90269
90279
  if (this.startDirectAnswer()) {
90270
90280
  const answers = this.profileAnswers();
90271
- const isAnswered = (q) => answers.some(a => a.profileQuestionId === q.id);
90272
- const firstUnanswered = this.filteredQuestions().find(q => !isAnswered(q));
90281
+ const firstUnanswered = this.filteredQuestions().find(q => !this.isQuestionAnswered(q, answers));
90273
90282
  if (firstUnanswered) {
90274
90283
  this.answerModeActive.set(true);
90275
90284
  this.questionForAnswer.set(firstUnanswered);
@@ -90853,6 +90862,12 @@ function ProfileStatusCardComponent_Conditional_26_Template(rf, ctx) { if (rf &
90853
90862
  i0.ɵɵconditional(ctx_r1.unansweredQuestions() > 0 ? 2 : -1);
90854
90863
  } }
90855
90864
  class ProfileStatusCardComponent {
90865
+ isQuestionAnswered(q, answers) {
90866
+ if ('answered' in q && typeof q.answered === 'boolean') {
90867
+ return q.answered;
90868
+ }
90869
+ return answers.some(a => a.profileQuestionId === q.id);
90870
+ }
90856
90871
  constructor() {
90857
90872
  this.viewMode = input(ViewModeEnum.LIGHT, ...(ngDevMode ? [{ debugName: "viewMode" }] : []));
90858
90873
  this.totalQuestions = input(0, ...(ngDevMode ? [{ debugName: "totalQuestions" }] : []));
@@ -90898,7 +90913,7 @@ class ProfileStatusCardComponent {
90898
90913
  this.computedAnsweredCount = computed(() => {
90899
90914
  const questions = this.questions();
90900
90915
  const answers = this.profileAnswers();
90901
- return questions.filter(q => answers.some(a => a.profileQuestionId === q.id)).length;
90916
+ return questions.filter(q => this.isQuestionAnswered(q, answers)).length;
90902
90917
  }, ...(ngDevMode ? [{ debugName: "computedAnsweredCount" }] : []));
90903
90918
  this.completionPercentage = computed(() => {
90904
90919
  const total = this.totalQuestions();
@@ -90940,7 +90955,7 @@ class ProfileStatusCardComponent {
90940
90955
  });
90941
90956
  const items = [];
90942
90957
  categoryMap.forEach((categoryQuestions, category) => {
90943
- const answeredCount = categoryQuestions.filter(q => answers.some(a => a.profileQuestionId === q.id)).length;
90958
+ const answeredCount = categoryQuestions.filter(q => this.isQuestionAnswered(q, answers)).length;
90944
90959
  const totalCount = categoryQuestions.length;
90945
90960
  const progress = totalCount > 0 ? (answeredCount / totalCount) * 100 : 0;
90946
90961
  items.push({
@@ -90986,7 +91001,7 @@ class ProfileStatusCardComponent {
90986
91001
  });
90987
91002
  const items = [];
90988
91003
  focusAreaMap.forEach((faQuestions, focusArea) => {
90989
- const answeredCount = faQuestions.filter(q => answers.some(a => a.profileQuestionId === q.id)).length;
91004
+ const answeredCount = faQuestions.filter(q => this.isQuestionAnswered(q, answers)).length;
90990
91005
  const totalCount = faQuestions.length;
90991
91006
  const progress = totalCount > 0 ? (answeredCount / totalCount) * 100 : 0;
90992
91007
  items.push({
@@ -95800,8 +95815,7 @@ class SymphiqProfileFocusAreaDashboardComponent {
95800
95815
  }, ...(ngDevMode ? [{ debugName: "totalQuestions" }] : []));
95801
95816
  this.answeredQuestions = computed(() => {
95802
95817
  const questions = this.profileFocusAreaQuestions() || [];
95803
- const answers = this.profileAnswers() || [];
95804
- return questions.filter(q => answers.some(a => a.profileQuestionId === q.id)).length;
95818
+ return questions.filter(q => q.answered === true).length;
95805
95819
  }, ...(ngDevMode ? [{ debugName: "answeredQuestions" }] : []));
95806
95820
  this.shouldShowStickyFooter = computed(() => {
95807
95821
  return this.profileFocusArea() && this.totalQuestions() > 0 && !this.isLoading();