@eric-emg/symphiq-components 1.2.183 → 1.2.184

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.
@@ -56320,7 +56320,7 @@ class FunnelMetricsVisualizationComponent {
56320
56320
  return { title, markdown };
56321
56321
  }
56322
56322
  static { this.ɵfac = function FunnelMetricsVisualizationComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FunnelMetricsVisualizationComponent)(); }; }
56323
- static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: FunnelMetricsVisualizationComponent, selectors: [["symphiq-funnel-metrics-visualization"]], inputs: { viewMode: [1, "viewMode"], calculations: [1, "calculations"], pacingMetrics: [1, "pacingMetrics"] }, decls: 5, vars: 0, consts: [[1, "space-y-6"], [1, "space-y-3"], [1, "rounded-xl", "p-6", "border-2", "transition-all", "duration-200", 3, "ngClass"], [1, "flex", "items-start", "justify-between", "mb-4"], [1, "flex-1"], [1, "flex", "items-center", "gap-2", "mb-1"], [1, "text-lg", "font-bold", "leading-tight", 3, "ngClass"], ["type", "button", "tooltipType", "markdown", "tooltipPosition", "right", 1, "flex-shrink-0", "w-6", "h-6", "rounded-full", "inline-flex", "items-center", "justify-center", "transition-colors", 3, "ngClass", "libSymphiqTooltip"], [1, "flex", "items-center", "gap-3"], [3, "viewMode", "pacingPercentage", "status"], [1, "px-4", "py-2", "rounded-lg", "font-bold", "text-sm", 3, "ngClass"], [1, "grid", "grid-cols-3", "gap-4", "mb-4"], [1, "text-xs", "font-medium", "uppercase", "tracking-wider", "mb-1", 3, "ngClass"], [1, "text-2xl", "font-bold", 3, "ngClass"], ["fill", "none", "stroke", "currentColor", "viewBox", "0 0 24 24", 1, "w-4", "h-4"], ["stroke-linecap", "round", "stroke-linejoin", "round", "stroke-width", "2", "d", "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"], [1, "my-4", 3, "ngClass"], [1, "space-y-2"], [1, "text-xs", "font-semibold", "uppercase", "tracking-wider", "mb-3", 3, "ngClass"], [1, "grid", "gap-2"], [1, "p-3", "rounded-lg", 3, "ngClass"], [1, "flex", "items-center", "justify-between", "mb-2"], [1, "flex", "items-center", "gap-2", "flex-1"], [1, "text-sm", "font-semibold", "leading-tight", 3, "ngClass"], ["type", "button", "tooltipType", "markdown", "tooltipPosition", "right", 1, "flex-shrink-0", "w-5", "h-5", "rounded-full", "inline-flex", "items-center", "justify-center", "transition-colors", 3, "ngClass", "libSymphiqTooltip"], [1, "flex", "items-center", "gap-2"], [1, "px-2", "py-1", "rounded", "text-xs", "font-bold", 3, "ngClass"], [1, "grid", "gap-2", "text-xs", 3, "ngClass"], [3, "ngClass"], ["fill", "none", "stroke", "currentColor", "viewBox", "0 0 24 24", 1, "w-3.5", "h-3.5"]], template: function FunnelMetricsVisualizationComponent_Template(rf, ctx) { if (rf & 1) {
56323
+ static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: FunnelMetricsVisualizationComponent, selectors: [["symphiq-funnel-metrics-visualization"]], inputs: { viewMode: [1, "viewMode"], calculations: [1, "calculations"], pacingMetrics: [1, "pacingMetrics"] }, decls: 5, vars: 0, consts: [[1, "space-y-6"], [1, "space-y-3"], [1, "rounded-xl", "p-6", "border-2", "transition-all", "duration-200", 3, "ngClass"], [1, "flex", "items-start", "justify-between", "mb-4"], [1, "flex-1"], [1, "flex", "items-center", "gap-2", "mb-1"], [1, "text-lg", "font-bold", "leading-tight", "m-0", 3, "ngClass"], ["type", "button", "tooltipType", "markdown", "tooltipPosition", "right", 1, "flex-shrink-0", "w-6", "h-6", "rounded-full", "inline-flex", "items-center", "justify-center", "transition-colors", 3, "ngClass", "libSymphiqTooltip"], [1, "flex", "items-center", "gap-3"], [3, "viewMode", "pacingPercentage", "status"], [1, "px-4", "py-2", "rounded-lg", "font-bold", "text-sm", 3, "ngClass"], [1, "grid", "grid-cols-3", "gap-4", "mb-4"], [1, "text-xs", "font-medium", "uppercase", "tracking-wider", "mb-1", 3, "ngClass"], [1, "text-2xl", "font-bold", 3, "ngClass"], ["fill", "none", "stroke", "currentColor", "viewBox", "0 0 24 24", 1, "w-4", "h-4"], ["stroke-linecap", "round", "stroke-linejoin", "round", "stroke-width", "2", "d", "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"], [1, "my-4", 3, "ngClass"], [1, "space-y-2"], [1, "text-xs", "font-semibold", "uppercase", "tracking-wider", "mb-3", 3, "ngClass"], [1, "grid", "gap-2"], [1, "p-3", "rounded-lg", 3, "ngClass"], [1, "flex", "items-center", "justify-between", "mb-2"], [1, "flex", "items-center", "gap-2", "flex-1"], [1, "text-sm", "font-semibold", "leading-tight", 3, "ngClass"], ["type", "button", "tooltipType", "markdown", "tooltipPosition", "right", 1, "flex-shrink-0", "w-5", "h-5", "rounded-full", "inline-flex", "items-center", "justify-center", "transition-colors", 3, "ngClass", "libSymphiqTooltip"], [1, "flex", "items-center", "gap-2"], [1, "px-2", "py-1", "rounded", "text-xs", "font-bold", 3, "ngClass"], [1, "grid", "gap-2", "text-xs", 3, "ngClass"], [3, "ngClass"], ["fill", "none", "stroke", "currentColor", "viewBox", "0 0 24 24", 1, "w-3.5", "h-3.5"]], template: function FunnelMetricsVisualizationComponent_Template(rf, ctx) { if (rf & 1) {
56324
56324
  i0.ɵɵelementStart(0, "div", 0);
56325
56325
  i0.ɵɵelement(1, "symphiq-tooltip-container");
56326
56326
  i0.ɵɵelementStart(2, "div", 1);
@@ -56347,7 +56347,7 @@ class FunnelMetricsVisualizationComponent {
56347
56347
  <div class="flex items-start justify-between mb-4">
56348
56348
  <div class="flex-1">
56349
56349
  <div class="flex items-center gap-2 mb-1">
56350
- <h3 [ngClass]="stageTitleClasses()" class="text-lg font-bold leading-tight">
56350
+ <h3 [ngClass]="stageTitleClasses()" class="text-lg font-bold leading-tight m-0">
56351
56351
  {{ getMetricTitle(stage.stageMetric) }}
56352
56352
  </h3>
56353
56353
  @if (stage.stageMetric.description) {
@@ -57399,27 +57399,34 @@ function transformTrendUiDataToChartSeries(trendUiData, metricToExtract) {
57399
57399
  return [];
57400
57400
  const dateIndex = convertedData.dimensions?.indexOf(DimensionEnum.DATE);
57401
57401
  const monthIndex = convertedData.dimensions?.indexOf(DimensionEnum.MONTH);
57402
- if (dateIndex === undefined || dateIndex === -1) {
57403
- if (monthIndex === undefined || monthIndex === -1)
57404
- return [];
57405
- return extractSeriesFromConvertedData(convertedData, metricToExtract, 'Current Year')
57406
- ? [extractSeriesFromConvertedData(convertedData, metricToExtract, 'Current Year')]
57407
- : [];
57408
- }
57402
+ const dimensionIndex = dateIndex !== undefined && dateIndex !== -1
57403
+ ? dateIndex
57404
+ : (monthIndex !== undefined && monthIndex !== -1 ? monthIndex : -1);
57405
+ if (dimensionIndex === -1)
57406
+ return [];
57409
57407
  const currentYear = new Date().getFullYear();
57410
57408
  const priorYear = currentYear - 1;
57411
57409
  const priorYearPoints = [];
57412
57410
  const currentYearPoints = [];
57413
- console.log('[transformTrendUiDataToChartSeries] dimensions:', convertedData.dimensions);
57414
- console.log('[transformTrendUiDataToChartSeries] dateIndex:', dateIndex, 'monthIndex:', monthIndex);
57415
- console.log('[transformTrendUiDataToChartSeries] sample rows:', convertedData.rows?.slice(0, 3));
57416
57411
  convertedData.rows?.forEach((row) => {
57417
- const dateValue = row.dimensionValues?.[dateIndex];
57412
+ const dimValue = row.dimensionValues?.[dimensionIndex];
57418
57413
  const metricValue = parseFloat(row.metricValues?.[metricIndex] || '0');
57419
- if (dateValue) {
57420
- const year = parseInt(dateValue.substring(0, 4), 10);
57421
- const month = parseInt(dateValue.substring(4, 6) || dateValue.substring(5, 7), 10);
57422
- console.log('[transformTrendUiDataToChartSeries] dateValue:', dateValue, '→ year:', year, 'month:', month);
57414
+ if (dimValue) {
57415
+ let year;
57416
+ let month;
57417
+ if (dimValue.includes('-')) {
57418
+ const parts = dimValue.split('-');
57419
+ year = parseInt(parts[0], 10);
57420
+ month = parseInt(parts[1], 10);
57421
+ }
57422
+ else if (dimValue.length >= 6) {
57423
+ year = parseInt(dimValue.substring(0, 4), 10);
57424
+ month = parseInt(dimValue.substring(4, 6), 10);
57425
+ }
57426
+ else {
57427
+ month = parseInt(dimValue, 10);
57428
+ year = currentYear;
57429
+ }
57423
57430
  const point = {
57424
57431
  category: String(month),
57425
57432
  value: metricValue,
@@ -57436,13 +57443,13 @@ function transformTrendUiDataToChartSeries(trendUiData, metricToExtract) {
57436
57443
  const series = [];
57437
57444
  if (priorYearPoints.length > 0) {
57438
57445
  series.push({
57439
- name: 'Prior Year',
57446
+ name: String(priorYear),
57440
57447
  data: aggregateAndSortByMonth(priorYearPoints)
57441
57448
  });
57442
57449
  }
57443
57450
  if (currentYearPoints.length > 0) {
57444
57451
  series.push({
57445
- name: 'Current Year',
57452
+ name: String(currentYear),
57446
57453
  data: aggregateAndSortByMonth(currentYearPoints)
57447
57454
  });
57448
57455
  }
@@ -57776,19 +57783,14 @@ class InitialTargetSettingComponent {
57776
57783
  }, ...(ngDevMode ? [{ debugName: "showMetricsVisualization" }] : []));
57777
57784
  this.revenueChartData = computed(() => {
57778
57785
  const trendData = this.trendUiData();
57779
- console.log('[revenueChartData] trendData:', trendData);
57780
- console.log('[revenueChartData] convertedDataResults:', trendData?.convertedDataResults);
57781
57786
  if (!trendData?.convertedDataResults) {
57782
- console.log('[revenueChartData] No convertedDataResults, returning null');
57783
57787
  return null;
57784
57788
  }
57785
57789
  const series = transformTrendUiDataToChartSeries(trendData, MetricEnum.PURCHASE_REVENUE);
57786
- console.log('[revenueChartData] series:', series);
57787
57790
  if (series.length === 0) {
57788
- console.log('[revenueChartData] Empty series, returning null');
57789
57791
  return null;
57790
57792
  }
57791
- const result = {
57793
+ return {
57792
57794
  title: 'Revenue Trend',
57793
57795
  areaChartData: {
57794
57796
  series: series.map(s => ({
@@ -57800,8 +57802,6 @@ class InitialTargetSettingComponent {
57800
57802
  }))
57801
57803
  }
57802
57804
  };
57803
- console.log('[revenueChartData] result:', result);
57804
- return result;
57805
57805
  }, ...(ngDevMode ? [{ debugName: "revenueChartData" }] : []));
57806
57806
  this.currentYear = computed(() => new Date().getFullYear(), ...(ngDevMode ? [{ debugName: "currentYear" }] : []));
57807
57807
  this.priorYear = computed(() => new Date().getFullYear() - 1, ...(ngDevMode ? [{ debugName: "priorYear" }] : []));