@eric-emg/symphiq-components 1.2.265 → 1.2.266

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.
@@ -60828,7 +60828,17 @@ class InitialTargetSettingComponent {
60828
60828
  continue;
60829
60829
  const targetValue = target.amount ?? 0;
60830
60830
  const currentValue = sumMetricFromUiData(this.mainUiData(), metric, 'priorYear');
60831
- const percentageIncrease = currentValue > 0 ? ((targetValue - currentValue) / currentValue) * 100 : 0;
60831
+ const isPercentageMetric = MetricEnumUtil.numberType(metric) === NumberTypeEnum.PERCENTAGE;
60832
+ let percentageIncrease = 0;
60833
+ if (currentValue > 0) {
60834
+ if (isPercentageMetric) {
60835
+ const normalizedCurrent = currentValue * 100;
60836
+ percentageIncrease = ((targetValue - normalizedCurrent) / normalizedCurrent) * 100;
60837
+ }
60838
+ else {
60839
+ percentageIncrease = ((targetValue - currentValue) / currentValue) * 100;
60840
+ }
60841
+ }
60832
60842
  const funnelMetricMatch = funnelMetrics.find(fm => fm.funnelMetric === metric && fm.funnelMetric === fm.relatedMetric);
60833
60843
  const relatedMetricMatch = funnelMetrics.find(fm => fm.relatedMetric === metric && fm.funnelMetric !== fm.relatedMetric);
60834
60844
  if (funnelMetricMatch) {
@@ -61758,7 +61768,7 @@ class InitialTargetSettingComponent {
61758
61768
  type: ViewChild,
61759
61769
  args: ['percentageInputRef']
61760
61770
  }], 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 }); })();
61771
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(InitialTargetSettingComponent, { className: "InitialTargetSettingComponent", filePath: "lib/components/revenue-calculator-dashboard/initial-target-setting.component.ts", lineNumber: 578 }); })();
61762
61772
 
61763
61773
  function IndeterminateSpinnerComponent_For_5_Template(rf, ctx) { if (rf & 1) {
61764
61774
  i0.ɵɵelement(0, "div", 5);