@eric-emg/symphiq-components 1.2.213 → 1.2.214

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.
@@ -56373,7 +56373,7 @@ function InitialTargetSettingComponent_Conditional_33_Conditional_7_Template(rf,
56373
56373
  i0.ɵɵtext(0);
56374
56374
  } if (rf & 2) {
56375
56375
  const ctx_r0 = i0.ɵɵnextContext(2);
56376
- i0.ɵɵtextInterpolate1(" > ", ctx_r0.formatCurrency(ctx_r0.calculatedRevenue()), " ");
56376
+ i0.ɵɵtextInterpolate1(" > ", ctx_r0.formatCurrency(ctx_r0.submittedAbsoluteInput()), " ");
56377
56377
  } }
56378
56378
  function InitialTargetSettingComponent_Conditional_33_Conditional_8_Template(rf, ctx) { if (rf & 1) {
56379
56379
  i0.ɵɵtext(0);
@@ -56482,7 +56482,7 @@ function InitialTargetSettingComponent_Conditional_33_Template(rf, ctx) { if (rf
56482
56482
  i0.ɵɵadvance();
56483
56483
  i0.ɵɵproperty("ngClass", ctx_r0.calculatedValueClasses());
56484
56484
  i0.ɵɵadvance();
56485
- i0.ɵɵconditional(ctx_r0.calculationState() === "results" && ctx_r0.targets() === undefined ? 7 : 8);
56485
+ i0.ɵɵconditional(ctx_r0.calculationState() === "results" && ctx_r0.targets() === undefined && ctx_r0.submittedAbsoluteInput() !== null ? 7 : 8);
56486
56486
  i0.ɵɵadvance(2);
56487
56487
  i0.ɵɵconditional(ctx_r0.calculationState() === "results" && ctx_r0.targets() === undefined ? 9 : -1);
56488
56488
  i0.ɵɵadvance(3);
@@ -56578,6 +56578,7 @@ class InitialTargetSettingComponent {
56578
56578
  this.percentageInput = signal(null, ...(ngDevMode ? [{ debugName: "percentageInput" }] : []));
56579
56579
  this.calculationState = signal('input', ...(ngDevMode ? [{ debugName: "calculationState" }] : []));
56580
56580
  this.storedResponse = signal(null, ...(ngDevMode ? [{ debugName: "storedResponse" }] : []));
56581
+ this.submittedAbsoluteInput = signal(null, ...(ngDevMode ? [{ debugName: "submittedAbsoluteInput" }] : []));
56581
56582
  this.priorYearRevenue = computed(() => {
56582
56583
  return sumMetricFromUiData(this.mainUiData(), MetricEnum.PURCHASE_REVENUE, 'priorYear');
56583
56584
  }, ...(ngDevMode ? [{ debugName: "priorYearRevenue" }] : []));
@@ -56834,6 +56835,7 @@ class InitialTargetSettingComponent {
56834
56835
  handleCalculateRequest() {
56835
56836
  if (!this.isValid())
56836
56837
  return;
56838
+ this.submittedAbsoluteInput.set(this.calculatedRevenue());
56837
56839
  this.calculationState.set('calculating');
56838
56840
  const request = {
56839
56841
  shopId: this.shopId(),
@@ -56854,12 +56856,12 @@ class InitialTargetSettingComponent {
56854
56856
  this.calculationState.set('input');
56855
56857
  }
56856
56858
  handleCancel() {
56857
- const response = this.storedResponse();
56858
- if (response && response.targetRevenue) {
56859
- this.absoluteInput.set(response.targetRevenue);
56859
+ const submittedValue = this.submittedAbsoluteInput();
56860
+ if (submittedValue !== null) {
56861
+ this.absoluteInput.set(submittedValue);
56860
56862
  const priorRevenue = this.priorYearRevenue();
56861
56863
  if (priorRevenue > 0) {
56862
- const pct = ((response.targetRevenue - priorRevenue) / priorRevenue) * 100;
56864
+ const pct = ((submittedValue - priorRevenue) / priorRevenue) * 100;
56863
56865
  this.percentageInput.set(pct);
56864
56866
  }
56865
56867
  }
@@ -57293,8 +57295,8 @@ class InitialTargetSettingComponent {
57293
57295
  {{ currentYear() }} Revenue Target
57294
57296
  </p>
57295
57297
  <p [ngClass]="calculatedValueClasses()" class="text-3xl font-bold">
57296
- @if (calculationState() === 'results' && targets() === undefined) {
57297
- > {{ formatCurrency(calculatedRevenue()) }}
57298
+ @if (calculationState() === 'results' && targets() === undefined && submittedAbsoluteInput() !== null) {
57299
+ > {{ formatCurrency(submittedAbsoluteInput()!) }}
57298
57300
  } @else {
57299
57301
  {{ formatCurrency(displayedTargetRevenue()) }}
57300
57302
  }