@eric-emg/symphiq-components 1.2.185 → 1.2.187
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.
- package/fesm2022/symphiq-components.mjs +44 -16
- package/fesm2022/symphiq-components.mjs.map +1 -1
- package/index.d.ts +25 -24
- package/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -56933,10 +56933,11 @@ class AreaChartComponent {
|
|
|
56933
56933
|
this.showAxisLabels = input(false, ...(ngDevMode ? [{ debugName: "showAxisLabels" }] : []));
|
|
56934
56934
|
this.viewMode = input(ViewModeEnum.LIGHT, ...(ngDevMode ? [{ debugName: "viewMode" }] : []));
|
|
56935
56935
|
this.currencySymbol = input('$', ...(ngDevMode ? [{ debugName: "currencySymbol" }] : []));
|
|
56936
|
+
this.height = input(undefined, ...(ngDevMode ? [{ debugName: "height" }] : []));
|
|
56936
56937
|
// Memoized computed signals to avoid recalculation on every change detection
|
|
56937
|
-
this.chartHeight = computed(() => this.showAxisLabels()
|
|
56938
|
+
this.chartHeight = computed(() => this.height() ?? (this.showAxisLabels()
|
|
56938
56939
|
? ChartConstants.HEIGHT.EXPANDED.AREA
|
|
56939
|
-
: ChartConstants.HEIGHT.COMPACT.AREA, ...(ngDevMode ? [{ debugName: "chartHeight" }] : []));
|
|
56940
|
+
: ChartConstants.HEIGHT.COMPACT.AREA), ...(ngDevMode ? [{ debugName: "chartHeight" }] : []));
|
|
56940
56941
|
this.cursorColor = computed(() => this.viewMode() === ViewModeEnum.DARK
|
|
56941
56942
|
? ChartConstants.COLORS.CURSOR.DARK
|
|
56942
56943
|
: ChartConstants.COLORS.CURSOR.LIGHT, ...(ngDevMode ? [{ debugName: "cursorColor" }] : []));
|
|
@@ -57238,7 +57239,7 @@ class AreaChartComponent {
|
|
|
57238
57239
|
} if (rf & 2) {
|
|
57239
57240
|
let _t;
|
|
57240
57241
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.chartDiv = _t.first);
|
|
57241
|
-
} }, inputs: { chart: [1, "chart"], showAxisLabels: [1, "showAxisLabels"], viewMode: [1, "viewMode"], currencySymbol: [1, "currencySymbol"] }, decls: 3, vars: 4, consts: [["chartdiv", ""], [1, "chart-container"], [1, "chart", 2, "width", "100%"]], template: function AreaChartComponent_Template(rf, ctx) { if (rf & 1) {
|
|
57242
|
+
} }, inputs: { chart: [1, "chart"], showAxisLabels: [1, "showAxisLabels"], viewMode: [1, "viewMode"], currencySymbol: [1, "currencySymbol"], height: [1, "height"] }, decls: 3, vars: 4, consts: [["chartdiv", ""], [1, "chart-container"], [1, "chart", 2, "width", "100%"]], template: function AreaChartComponent_Template(rf, ctx) { if (rf & 1) {
|
|
57242
57243
|
i0.ɵɵdomElementStart(0, "div", 1);
|
|
57243
57244
|
i0.ɵɵdomElement(1, "div", 2, 0);
|
|
57244
57245
|
i0.ɵɵdomElementEnd();
|
|
@@ -57250,12 +57251,12 @@ class AreaChartComponent {
|
|
|
57250
57251
|
}
|
|
57251
57252
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AreaChartComponent, [{
|
|
57252
57253
|
type: Component,
|
|
57253
|
-
args: [{ selector: 'symphiq-area-chart', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
57254
|
-
<div class="chart-container" [class.mini-mode]="!showAxisLabels()">
|
|
57255
|
-
<div #chartdiv class="chart" [style.height]="chartHeight()" style="width: 100%;"></div>
|
|
57256
|
-
</div>
|
|
57254
|
+
args: [{ selector: 'symphiq-area-chart', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
57255
|
+
<div class="chart-container" [class.mini-mode]="!showAxisLabels()">
|
|
57256
|
+
<div #chartdiv class="chart" [style.height]="chartHeight()" style="width: 100%;"></div>
|
|
57257
|
+
</div>
|
|
57257
57258
|
`, styles: [".chart-container{width:100%;padding:1rem}.chart-container.mini-mode{padding:.25rem}\n"] }]
|
|
57258
|
-
}], () => [], { chart: [{ type: i0.Input, args: [{ isSignal: true, alias: "chart", required: false }] }], showAxisLabels: [{ type: i0.Input, args: [{ isSignal: true, alias: "showAxisLabels", required: false }] }], viewMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "viewMode", required: false }] }], currencySymbol: [{ type: i0.Input, args: [{ isSignal: true, alias: "currencySymbol", required: false }] }], chartDiv: [{
|
|
57259
|
+
}], () => [], { chart: [{ type: i0.Input, args: [{ isSignal: true, alias: "chart", required: false }] }], showAxisLabels: [{ type: i0.Input, args: [{ isSignal: true, alias: "showAxisLabels", required: false }] }], viewMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "viewMode", required: false }] }], currencySymbol: [{ type: i0.Input, args: [{ isSignal: true, alias: "currencySymbol", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], chartDiv: [{
|
|
57259
57260
|
type: ViewChild,
|
|
57260
57261
|
args: ['chartdiv', { static: true }]
|
|
57261
57262
|
}] }); })();
|
|
@@ -57278,17 +57279,43 @@ function calculateMetricTargetsFromRevenue(revenueTarget, priorYearRevenue, funn
|
|
|
57278
57279
|
const bRelated = b.relatedInd ?? 999;
|
|
57279
57280
|
return aRelated - bRelated;
|
|
57280
57281
|
});
|
|
57282
|
+
const funnelStages = new Set();
|
|
57283
|
+
const relatedMetricsPerStage = new Map();
|
|
57284
|
+
sortedFunnelMetrics.forEach((fm) => {
|
|
57285
|
+
const funnelInd = fm.funnelInd ?? 0;
|
|
57286
|
+
funnelStages.add(funnelInd);
|
|
57287
|
+
const isFunnelStage = fm.funnelMetric === fm.relatedMetric;
|
|
57288
|
+
if (!isFunnelStage) {
|
|
57289
|
+
relatedMetricsPerStage.set(funnelInd, (relatedMetricsPerStage.get(funnelInd) || 0) + 1);
|
|
57290
|
+
}
|
|
57291
|
+
});
|
|
57292
|
+
const numFunnelStages = funnelStages.size;
|
|
57293
|
+
const revenueMultiplier = 1 + revenuePercentageIncrease / 100;
|
|
57294
|
+
const perStageMultiplier = Math.pow(revenueMultiplier, 1 / numFunnelStages);
|
|
57295
|
+
const funnelStagePercentageIncrease = (perStageMultiplier - 1) * 100;
|
|
57281
57296
|
sortedFunnelMetrics.forEach((funnelMetric) => {
|
|
57282
57297
|
const metric = funnelMetric.relatedMetric;
|
|
57283
57298
|
if (!metric)
|
|
57284
57299
|
return;
|
|
57285
57300
|
const currentValue = baselineValues.get(metric) || 0;
|
|
57286
|
-
let percentageIncrease = revenuePercentageIncrease;
|
|
57287
57301
|
const isFunnelStage = funnelMetric.funnelMetric === metric;
|
|
57288
|
-
|
|
57289
|
-
|
|
57302
|
+
const funnelInd = funnelMetric.funnelInd ?? 0;
|
|
57303
|
+
const isBounceRate = metric === MetricEnum.BOUNCE_RATE;
|
|
57304
|
+
let percentageIncrease;
|
|
57305
|
+
let targetValue;
|
|
57306
|
+
if (isBounceRate) {
|
|
57307
|
+
percentageIncrease = -funnelStagePercentageIncrease;
|
|
57308
|
+
targetValue = currentValue * (1 + percentageIncrease / 100);
|
|
57309
|
+
}
|
|
57310
|
+
else if (isFunnelStage) {
|
|
57311
|
+
percentageIncrease = funnelStagePercentageIncrease;
|
|
57312
|
+
targetValue = currentValue * (1 + percentageIncrease / 100);
|
|
57313
|
+
}
|
|
57314
|
+
else {
|
|
57315
|
+
const numRelatedInStage = relatedMetricsPerStage.get(funnelInd) || 1;
|
|
57316
|
+
percentageIncrease = funnelStagePercentageIncrease / numRelatedInStage;
|
|
57317
|
+
targetValue = currentValue * (1 + percentageIncrease / 100);
|
|
57290
57318
|
}
|
|
57291
|
-
const targetValue = currentValue * (1 + percentageIncrease / 100);
|
|
57292
57319
|
metricCalculations.push({
|
|
57293
57320
|
metric,
|
|
57294
57321
|
funnelMetric: funnelMetric.funnelMetric,
|
|
@@ -57667,7 +57694,7 @@ function InitialTargetSettingComponent_Conditional_25_Template(rf, ctx) { if (rf
|
|
|
57667
57694
|
i0.ɵɵelement(0, "symphiq-area-chart", 15);
|
|
57668
57695
|
} if (rf & 2) {
|
|
57669
57696
|
const ctx_r0 = i0.ɵɵnextContext();
|
|
57670
|
-
i0.ɵɵproperty("chart", ctx_r0.revenueChartData())("showAxisLabels", true)("viewMode", ctx_r0.viewMode())("currencySymbol", "$");
|
|
57697
|
+
i0.ɵɵproperty("chart", ctx_r0.revenueChartData())("showAxisLabels", true)("viewMode", ctx_r0.viewMode())("currencySymbol", "$")("height", "320px");
|
|
57671
57698
|
} }
|
|
57672
57699
|
function InitialTargetSettingComponent_Conditional_26_Template(rf, ctx) { if (rf & 1) {
|
|
57673
57700
|
i0.ɵɵelementStart(0, "div", 16)(1, "p", 27);
|
|
@@ -57945,7 +57972,7 @@ class InitialTargetSettingComponent {
|
|
|
57945
57972
|
} if (rf & 2) {
|
|
57946
57973
|
let _t;
|
|
57947
57974
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.absoluteInputRef = _t.first);
|
|
57948
|
-
} }, inputs: { viewMode: [1, "viewMode"], funnelMetrics: [1, "funnelMetrics"], mainUiData: [1, "mainUiData"], yoyUiData: [1, "yoyUiData"], trendUiData: [1, "trendUiData"], shopId: [1, "shopId"], pacingMetrics: [1, "pacingMetrics"], dataResults: [1, "dataResults"] }, outputs: { targetsCreated: "targetsCreated" }, decls: 29, vars: 21, consts: [["absoluteInputRef", ""], [1, "space-y-8", "pb-32"], [1, "rounded-2xl", "border", "shadow-lg", "p-8", 3, "ngClass"], [1, "text-2xl", "font-bold", "mb-6", 3, "ngClass"], [1, "grid", "lg:grid-cols-2", "gap-8"], [1, "space-y-6"], [1, "block", "text-sm", "font-semibold", "mb-2", 3, "ngClass"], [1, "space-y-1", "mb-4"], [1, "text-xs", 3, "ngClass"], [1, "flex", "gap-2", "mb-4"], [1, "flex-1", "py-2", "px-4", "rounded-lg", "text-sm", "font-semibold", "transition-all", 3, "click", "ngClass"], [1, "relative"], [1, "p-6", "rounded-xl", "border-2", 3, "ngClass"], [1, "text-sm", "font-semibold", "mb-3", 3, "ngClass"], [1, "rounded-xl", "border", "p-4", 3, "ngClass"], [3, "chart", "showAxisLabels", "viewMode", "currencySymbol"], [1, "h-64", "flex", "items-center", "justify-center"], [3, "submitClick", "viewMode", "isValid", "isSubmitting", "validationMessage", "buttonText"], [1, "absolute", "left-4", "top-1/2", "-translate-y-1/2", "text-xl", "font-bold", 3, "ngClass"], ["type", "number", "placeholder", "0", "min", "0", "step", "1000", 1, "w-full", "pl-10", "pr-4", "py-4", "rounded-xl", "text-2xl", "font-bold", "border-2", "transition-all", 3, "ngModelChange", "ngModel", "ngClass"], ["type", "number", "placeholder", "0", "min", "0", "max", "1000", "step", "0.1", 1, "w-full", "pr-10", "pl-4", "py-4", "rounded-xl", "text-2xl", "font-bold", "border-2", "transition-all", 3, "ngModelChange", "ngModel", "ngClass"], [1, "absolute", "right-4", "top-1/2", "-translate-y-1/2", "text-xl", "font-bold", 3, "ngClass"], [1, "space-y-4"], [1, "text-xs", "font-medium", "uppercase", "tracking-wider", "mb-1", 3, "ngClass"], [1, "text-3xl", "font-bold", 3, "ngClass"], [1, "grid", "grid-cols-2", "gap-4", "pt-4", 3, "ngClass"], [1, "text-xl", "font-bold", 3, "ngClass"], [1, "text-sm", 3, "ngClass"], [1, "mb-6"], [1, "text-2xl", "font-bold", "mb-2", 3, "ngClass"], [3, "viewMode", "calculations", "pacingMetrics"]], template: function InitialTargetSettingComponent_Template(rf, ctx) { if (rf & 1) {
|
|
57975
|
+
} }, inputs: { viewMode: [1, "viewMode"], funnelMetrics: [1, "funnelMetrics"], mainUiData: [1, "mainUiData"], yoyUiData: [1, "yoyUiData"], trendUiData: [1, "trendUiData"], shopId: [1, "shopId"], pacingMetrics: [1, "pacingMetrics"], dataResults: [1, "dataResults"] }, outputs: { targetsCreated: "targetsCreated" }, decls: 29, vars: 21, consts: [["absoluteInputRef", ""], [1, "space-y-8", "pb-32"], [1, "rounded-2xl", "border", "shadow-lg", "p-8", 3, "ngClass"], [1, "text-2xl", "font-bold", "mb-6", 3, "ngClass"], [1, "grid", "lg:grid-cols-2", "gap-8"], [1, "space-y-6"], [1, "block", "text-sm", "font-semibold", "mb-2", 3, "ngClass"], [1, "space-y-1", "mb-4"], [1, "text-xs", 3, "ngClass"], [1, "flex", "gap-2", "mb-4"], [1, "flex-1", "py-2", "px-4", "rounded-lg", "text-sm", "font-semibold", "transition-all", 3, "click", "ngClass"], [1, "relative"], [1, "p-6", "rounded-xl", "border-2", 3, "ngClass"], [1, "text-sm", "font-semibold", "mb-3", 3, "ngClass"], [1, "rounded-xl", "border", "p-4", 3, "ngClass"], [3, "chart", "showAxisLabels", "viewMode", "currencySymbol", "height"], [1, "h-64", "flex", "items-center", "justify-center"], [3, "submitClick", "viewMode", "isValid", "isSubmitting", "validationMessage", "buttonText"], [1, "absolute", "left-4", "top-1/2", "-translate-y-1/2", "text-xl", "font-bold", 3, "ngClass"], ["type", "number", "placeholder", "0", "min", "0", "step", "1000", 1, "w-full", "pl-10", "pr-4", "py-4", "rounded-xl", "text-2xl", "font-bold", "border-2", "transition-all", 3, "ngModelChange", "ngModel", "ngClass"], ["type", "number", "placeholder", "0", "min", "0", "max", "1000", "step", "0.1", 1, "w-full", "pr-10", "pl-4", "py-4", "rounded-xl", "text-2xl", "font-bold", "border-2", "transition-all", 3, "ngModelChange", "ngModel", "ngClass"], [1, "absolute", "right-4", "top-1/2", "-translate-y-1/2", "text-xl", "font-bold", 3, "ngClass"], [1, "space-y-4"], [1, "text-xs", "font-medium", "uppercase", "tracking-wider", "mb-1", 3, "ngClass"], [1, "text-3xl", "font-bold", 3, "ngClass"], [1, "grid", "grid-cols-2", "gap-4", "pt-4", 3, "ngClass"], [1, "text-xl", "font-bold", 3, "ngClass"], [1, "text-sm", 3, "ngClass"], [1, "mb-6"], [1, "text-2xl", "font-bold", "mb-2", 3, "ngClass"], [3, "viewMode", "calculations", "pacingMetrics"]], template: function InitialTargetSettingComponent_Template(rf, ctx) { if (rf & 1) {
|
|
57949
57976
|
i0.ɵɵelementStart(0, "div", 1)(1, "div", 2)(2, "h2", 3);
|
|
57950
57977
|
i0.ɵɵtext(3, " Calculate Your Revenue Target ");
|
|
57951
57978
|
i0.ɵɵelementEnd();
|
|
@@ -57973,7 +58000,7 @@ class InitialTargetSettingComponent {
|
|
|
57973
58000
|
i0.ɵɵtext(23, " Year-over-Year Revenue Trend ");
|
|
57974
58001
|
i0.ɵɵelementEnd();
|
|
57975
58002
|
i0.ɵɵelementStart(24, "div", 14);
|
|
57976
|
-
i0.ɵɵconditionalCreate(25, InitialTargetSettingComponent_Conditional_25_Template, 1,
|
|
58003
|
+
i0.ɵɵconditionalCreate(25, InitialTargetSettingComponent_Conditional_25_Template, 1, 5, "symphiq-area-chart", 15)(26, InitialTargetSettingComponent_Conditional_26_Template, 3, 1, "div", 16);
|
|
57977
58004
|
i0.ɵɵelementEnd()()()();
|
|
57978
58005
|
i0.ɵɵconditionalCreate(27, InitialTargetSettingComponent_Conditional_27_Template, 7, 7, "div", 2);
|
|
57979
58006
|
i0.ɵɵelementStart(28, "symphiq-sticky-submit-bar", 17);
|
|
@@ -58168,6 +58195,7 @@ class InitialTargetSettingComponent {
|
|
|
58168
58195
|
[showAxisLabels]="true"
|
|
58169
58196
|
[viewMode]="viewMode()"
|
|
58170
58197
|
[currencySymbol]="'$'"
|
|
58198
|
+
[height]="'320px'"
|
|
58171
58199
|
/>
|
|
58172
58200
|
} @else {
|
|
58173
58201
|
<div class="h-64 flex items-center justify-center">
|
|
@@ -58215,7 +58243,7 @@ class InitialTargetSettingComponent {
|
|
|
58215
58243
|
type: ViewChild,
|
|
58216
58244
|
args: ['absoluteInputRef']
|
|
58217
58245
|
}], 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 }] }], yoyUiData: [{ type: i0.Input, args: [{ isSignal: true, alias: "yoyUiData", 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 }] }], targetsCreated: [{ type: i0.Output, args: ["targetsCreated"] }] }); })();
|
|
58218
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(InitialTargetSettingComponent, { className: "InitialTargetSettingComponent", filePath: "lib/components/revenue-calculator-dashboard/initial-target-setting.component.ts", lineNumber:
|
|
58246
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(InitialTargetSettingComponent, { className: "InitialTargetSettingComponent", filePath: "lib/components/revenue-calculator-dashboard/initial-target-setting.component.ts", lineNumber: 217 }); })();
|
|
58219
58247
|
|
|
58220
58248
|
function IndeterminateSpinnerComponent_For_5_Template(rf, ctx) { if (rf & 1) {
|
|
58221
58249
|
i0.ɵɵelement(0, "div", 5);
|