@eric-emg/symphiq-components 1.2.265 → 1.2.267

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.
@@ -59087,13 +59087,13 @@ function EditMetricTargetModalComponent_Conditional_0_Conditional_36_Conditional
59087
59087
  i0.ɵɵelement(5, "div", 46);
59088
59088
  i0.ɵɵelementEnd();
59089
59089
  i0.ɵɵelementStart(6, "div", 48)(7, "div")(8, "p", 49);
59090
- i0.ɵɵtext(9, " Gap to Close ");
59090
+ i0.ɵɵtext(9);
59091
59091
  i0.ɵɵelementEnd();
59092
59092
  i0.ɵɵelementStart(10, "p", 50);
59093
59093
  i0.ɵɵconditionalCreate(11, EditMetricTargetModalComponent_Conditional_0_Conditional_36_Conditional_25_Conditional_11_Template, 1, 1)(12, EditMetricTargetModalComponent_Conditional_0_Conditional_36_Conditional_25_Conditional_12_Template, 1, 0);
59094
59094
  i0.ɵɵelementEnd()();
59095
59095
  i0.ɵɵelementStart(13, "div")(14, "div", 51)(15, "p", 21);
59096
- i0.ɵɵtext(16, " Additional Growth Needed ");
59096
+ i0.ɵɵtext(16);
59097
59097
  i0.ɵɵelementEnd();
59098
59098
  i0.ɵɵelementStart(17, "button", 33);
59099
59099
  i0.ɵɵlistener("click", function EditMetricTargetModalComponent_Conditional_0_Conditional_36_Conditional_25_Template_button_click_17_listener($event) { i0.ɵɵrestoreView(_r8); return i0.ɵɵresetView($event.stopPropagation()); });
@@ -59112,19 +59112,23 @@ function EditMetricTargetModalComponent_Conditional_0_Conditional_36_Conditional
59112
59112
  i0.ɵɵadvance();
59113
59113
  i0.ɵɵproperty("ngClass", ctx_r1.dividerLabelClasses());
59114
59114
  i0.ɵɵadvance();
59115
- i0.ɵɵtextInterpolate1(" ", ctx_r1.currentYear(), " YTD Gap ");
59115
+ i0.ɵɵtextInterpolate1(" ", ctx_r1.gapDividerLabel(), " ");
59116
59116
  i0.ɵɵadvance();
59117
59117
  i0.ɵɵproperty("ngClass", ctx_r1.dividerBorderClasses());
59118
59118
  i0.ɵɵadvance(3);
59119
59119
  i0.ɵɵproperty("ngClass", ctx_r1.calculatedLabelClasses());
59120
- i0.ɵɵadvance(2);
59120
+ i0.ɵɵadvance();
59121
+ i0.ɵɵtextInterpolate1(" ", ctx_r1.gapLabel(), " ");
59122
+ i0.ɵɵadvance();
59121
59123
  i0.ɵɵproperty("ngClass", ctx_r1.calculatedSecondaryClasses());
59122
59124
  i0.ɵɵadvance();
59123
59125
  i0.ɵɵconditional(ctx_r1.isTargetValid() ? 11 : 12);
59124
59126
  i0.ɵɵadvance(4);
59125
59127
  i0.ɵɵproperty("ngClass", ctx_r1.calculatedLabelClasses());
59126
- i0.ɵɵadvance(2);
59127
- i0.ɵɵproperty("ngClass", ctx_r1.infoIconClasses())("libSymphiqTooltip", ctx_r1.additionalGrowthTooltip);
59128
+ i0.ɵɵadvance();
59129
+ i0.ɵɵtextInterpolate1(" ", ctx_r1.gapPercentageLabel(), " ");
59130
+ i0.ɵɵadvance();
59131
+ i0.ɵɵproperty("ngClass", ctx_r1.infoIconClasses())("libSymphiqTooltip", ctx_r1.gapTooltip());
59128
59132
  i0.ɵɵadvance(3);
59129
59133
  i0.ɵɵproperty("ngClass", ctx_r1.calculatedSecondaryClasses());
59130
59134
  i0.ɵɵadvance();
@@ -59156,7 +59160,7 @@ function EditMetricTargetModalComponent_Conditional_0_Conditional_36_Template(rf
59156
59160
  i0.ɵɵelementStart(22, "p", 50);
59157
59161
  i0.ɵɵconditionalCreate(23, EditMetricTargetModalComponent_Conditional_0_Conditional_36_Conditional_23_Template, 1, 2)(24, EditMetricTargetModalComponent_Conditional_0_Conditional_36_Conditional_24_Template, 1, 0);
59158
59162
  i0.ɵɵelementEnd()()()();
59159
- i0.ɵɵconditionalCreate(25, EditMetricTargetModalComponent_Conditional_0_Conditional_36_Conditional_25_Template, 23, 12, "div", 44);
59163
+ i0.ɵɵconditionalCreate(25, EditMetricTargetModalComponent_Conditional_0_Conditional_36_Conditional_25_Template, 23, 14, "div", 44);
59160
59164
  i0.ɵɵelementEnd();
59161
59165
  } if (rf & 2) {
59162
59166
  const ctx_r1 = i0.ɵɵnextContext(2);
@@ -59420,14 +59424,43 @@ class EditMetricTargetModalComponent {
59420
59424
  const percentage = (amount / projection) * 100;
59421
59425
  return { amount, percentage };
59422
59426
  }, ...(ngDevMode ? [{ debugName: "gapToClose" }] : []));
59427
+ this.isPaceAhead = computed(() => {
59428
+ const target = this.calculatedTarget();
59429
+ const projection = this.currentPaceProjection();
59430
+ if (target === 0 || projection === 0)
59431
+ return false;
59432
+ if (this.isIncreaseBad()) {
59433
+ return projection < target;
59434
+ }
59435
+ return projection > target;
59436
+ }, ...(ngDevMode ? [{ debugName: "isPaceAhead" }] : []));
59437
+ this.gapLabel = computed(() => {
59438
+ return this.isPaceAhead() ? 'Ahead by' : 'Gap to Close';
59439
+ }, ...(ngDevMode ? [{ debugName: "gapLabel" }] : []));
59440
+ this.gapPercentageLabel = computed(() => {
59441
+ return this.isPaceAhead() ? 'Ahead of Target' : 'Additional Growth Needed';
59442
+ }, ...(ngDevMode ? [{ debugName: "gapPercentageLabel" }] : []));
59443
+ this.gapDividerLabel = computed(() => {
59444
+ return this.isPaceAhead()
59445
+ ? `${this.currentYear()} Pace Status`
59446
+ : `${this.currentYear()} YTD Gap`;
59447
+ }, ...(ngDevMode ? [{ debugName: "gapDividerLabel" }] : []));
59448
+ this.gapTooltip = computed(() => {
59449
+ if (this.isPaceAhead()) {
59450
+ return {
59451
+ title: 'Ahead of Target',
59452
+ markdown: 'This percentage represents how far ahead your current projected pace is compared to your target. You are on track to exceed your goal if you maintain your current performance.'
59453
+ };
59454
+ }
59455
+ return {
59456
+ title: 'Additional Growth Needed',
59457
+ markdown: 'This percentage represents the additional improvement required beyond your current projected pace to reach your target. It shows how much more change is needed to close the gap between your projected performance and your goal.'
59458
+ };
59459
+ }, ...(ngDevMode ? [{ debugName: "gapTooltip" }] : []));
59423
59460
  this.currentPaceProjectionTooltip = {
59424
59461
  title: 'Current Pace Projection',
59425
59462
  markdown: 'This is your projected year-end value based on your current performance trends. It extrapolates your year-to-date results to estimate where you will finish the year if you maintain your current pace.'
59426
59463
  };
59427
- this.additionalGrowthTooltip = {
59428
- title: 'Additional Growth Needed',
59429
- markdown: 'This percentage represents the additional improvement required beyond your current projected pace to reach your target. It shows how much more change is needed to close the gap between your projected performance and your goal.'
59430
- };
59431
59464
  effect(() => {
59432
59465
  if (this.isOpen()) {
59433
59466
  const metricData = this.metricData();
@@ -59535,7 +59568,7 @@ class EditMetricTargetModalComponent {
59535
59568
  normalizedAbsolute = currentAbsolute / 100;
59536
59569
  }
59537
59570
  const percentageChange = ((normalizedAbsolute - priorValue) / priorValue) * 100;
59538
- this.percentageInput.set(Math.abs(percentageChange));
59571
+ this.percentageInput.set(Math.round(Math.abs(percentageChange) * 100) / 100);
59539
59572
  }
59540
59573
  }
59541
59574
  this.updateAnimatedValuesImmediate();
@@ -60022,14 +60055,14 @@ class EditMetricTargetModalComponent {
60022
60055
  <div class="absolute top-0 left-0 right-0 flex items-center -translate-y-1/2">
60023
60056
  <div class="flex-1 h-px" [ngClass]="dividerBorderClasses()"></div>
60024
60057
  <span [ngClass]="dividerLabelClasses()" class="px-3 py-1 rounded-full text-xs font-semibold whitespace-nowrap">
60025
- {{ currentYear() }} YTD Gap
60058
+ {{ gapDividerLabel() }}
60026
60059
  </span>
60027
60060
  <div class="flex-1 h-px" [ngClass]="dividerBorderClasses()"></div>
60028
60061
  </div>
60029
60062
  <div class="grid grid-cols-2 gap-4 pt-2">
60030
60063
  <div>
60031
60064
  <p [ngClass]="calculatedLabelClasses()" class="text-xs font-medium uppercase tracking-wider mb-1">
60032
- Gap to Close
60065
+ {{ gapLabel() }}
60033
60066
  </p>
60034
60067
  <p [ngClass]="calculatedSecondaryClasses()" class="text-xl font-bold">
60035
60068
  @if (isTargetValid()) {
@@ -60042,13 +60075,13 @@ class EditMetricTargetModalComponent {
60042
60075
  <div>
60043
60076
  <div class="flex items-center gap-1 mb-1">
60044
60077
  <p [ngClass]="calculatedLabelClasses()" class="text-xs font-medium uppercase tracking-wider">
60045
- Additional Growth Needed
60078
+ {{ gapPercentageLabel() }}
60046
60079
  </p>
60047
60080
  <button
60048
60081
  type="button"
60049
60082
  [ngClass]="infoIconClasses()"
60050
60083
  class="flex-shrink-0 w-4 h-4 rounded-full inline-flex items-center justify-center transition-colors"
60051
- [libSymphiqTooltip]="additionalGrowthTooltip"
60084
+ [libSymphiqTooltip]="gapTooltip()"
60052
60085
  tooltipType="markdown"
60053
60086
  tooltipPosition="top"
60054
60087
  (click)="$event.stopPropagation()">
@@ -60828,7 +60861,17 @@ class InitialTargetSettingComponent {
60828
60861
  continue;
60829
60862
  const targetValue = target.amount ?? 0;
60830
60863
  const currentValue = sumMetricFromUiData(this.mainUiData(), metric, 'priorYear');
60831
- const percentageIncrease = currentValue > 0 ? ((targetValue - currentValue) / currentValue) * 100 : 0;
60864
+ const isPercentageMetric = MetricEnumUtil.numberType(metric) === NumberTypeEnum.PERCENTAGE;
60865
+ let percentageIncrease = 0;
60866
+ if (currentValue > 0) {
60867
+ if (isPercentageMetric) {
60868
+ const normalizedCurrent = currentValue * 100;
60869
+ percentageIncrease = ((targetValue - normalizedCurrent) / normalizedCurrent) * 100;
60870
+ }
60871
+ else {
60872
+ percentageIncrease = ((targetValue - currentValue) / currentValue) * 100;
60873
+ }
60874
+ }
60832
60875
  const funnelMetricMatch = funnelMetrics.find(fm => fm.funnelMetric === metric && fm.funnelMetric === fm.relatedMetric);
60833
60876
  const relatedMetricMatch = funnelMetrics.find(fm => fm.relatedMetric === metric && fm.funnelMetric !== fm.relatedMetric);
60834
60877
  if (funnelMetricMatch) {
@@ -61758,7 +61801,7 @@ class InitialTargetSettingComponent {
61758
61801
  type: ViewChild,
61759
61802
  args: ['percentageInputRef']
61760
61803
  }], viewMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "viewMode", required: false }] }], funnelMetrics: [{ type: i0.Input, args: [{ isSignal: true, alias: "funnelMetrics", required: false }] }], mainUiData: [{ type: i0.Input, args: [{ isSignal: true, alias: "mainUiData", required: false }] }], trendUiData: [{ type: i0.Input, args: [{ isSignal: true, alias: "trendUiData", required: false }] }], shopId: [{ type: i0.Input, args: [{ isSignal: true, alias: "shopId", required: false }] }], pacingMetrics: [{ type: i0.Input, args: [{ isSignal: true, alias: "pacingMetrics", required: false }] }], dataResults: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataResults", required: false }] }], reverseCalculationResponse: [{ type: i0.Input, args: [{ isSignal: true, alias: "reverseCalculationResponse", required: false }] }], targets: [{ type: i0.Input, args: [{ isSignal: true, alias: "targets", required: false }] }], targetsCreated: [{ type: i0.Output, args: ["targetsCreated"] }], calculateRevenueRequest: [{ type: i0.Output, args: ["calculateRevenueRequest"] }], editRelatedMetricTarget: [{ type: i0.Output, args: ["editRelatedMetricTarget"] }], saveTargetsClick: [{ type: i0.Output, args: ["saveTargetsClick"] }], discardChangesClick: [{ type: i0.Output, args: ["discardChangesClick"] }] }); })();
61761
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(InitialTargetSettingComponent, { className: "InitialTargetSettingComponent", filePath: "lib/components/revenue-calculator-dashboard/initial-target-setting.component.ts", lineNumber: 576 }); })();
61804
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(InitialTargetSettingComponent, { className: "InitialTargetSettingComponent", filePath: "lib/components/revenue-calculator-dashboard/initial-target-setting.component.ts", lineNumber: 578 }); })();
61762
61805
 
61763
61806
  function IndeterminateSpinnerComponent_For_5_Template(rf, ctx) { if (rf & 1) {
61764
61807
  i0.ɵɵelement(0, "div", 5);