@eric-emg/symphiq-components 1.2.336 → 1.2.338
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 +28 -6
- package/fesm2022/symphiq-components.mjs.map +1 -1
- package/index.d.ts +16 -15
- package/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -86915,11 +86915,21 @@ class PlanCardComponent {
|
|
|
86915
86915
|
formatPrice() {
|
|
86916
86916
|
const info = this.planInfo();
|
|
86917
86917
|
let price = info.planItemPrice.price || 0;
|
|
86918
|
-
|
|
86918
|
+
const periodUnit = info.planItemPrice.periodUnit;
|
|
86919
|
+
console.log('[formatPrice]', {
|
|
86920
|
+
externalName: info.planItemPrice.externalName,
|
|
86921
|
+
originalPrice: info.planItemPrice.price,
|
|
86922
|
+
periodUnit,
|
|
86923
|
+
isYear: periodUnit === ChargebeeItemPricePeriodUnitEnum.YEAR,
|
|
86924
|
+
yearEnumValue: ChargebeeItemPricePeriodUnitEnum.YEAR
|
|
86925
|
+
});
|
|
86926
|
+
if (periodUnit === ChargebeeItemPricePeriodUnitEnum.YEAR) {
|
|
86919
86927
|
price = price / 12;
|
|
86928
|
+
console.log('[formatPrice] divided by 12:', price);
|
|
86920
86929
|
}
|
|
86921
86930
|
const symbol = this.getCurrencySymbol();
|
|
86922
|
-
const formattedPrice = Math.floor(price
|
|
86931
|
+
const formattedPrice = Math.floor(price).toLocaleString();
|
|
86932
|
+
console.log('[formatPrice] final:', `${symbol}${formattedPrice}`);
|
|
86923
86933
|
return `${symbol}${formattedPrice}`;
|
|
86924
86934
|
}
|
|
86925
86935
|
getCurrencySymbol() {
|
|
@@ -87415,7 +87425,7 @@ class PlanSelectionContainerComponent {
|
|
|
87415
87425
|
: 'text-slate-500';
|
|
87416
87426
|
}
|
|
87417
87427
|
static { this.ɵfac = function PlanSelectionContainerComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || PlanSelectionContainerComponent)(); }; }
|
|
87418
|
-
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: PlanSelectionContainerComponent, selectors: [["symphiq-plan-selection-container"]], inputs: { viewMode: [1, "viewMode"], selectedCurrency: [1, "selectedCurrency"], planCardInfos: [1, "planCardInfos"], isLoading: [1, "isLoading"], selectedPeriodUnit: [1, "selectedPeriodUnit"] }, outputs: { periodUnitChanged: "periodUnitChanged", planSelected: "planSelected", editCurrency: "editCurrency" }, decls: 22, vars: 12, consts: [[1, "rounded-2xl", "border", "shadow-lg", "overflow-hidden", 3, "ngClass"], [1, "px-6", "py-5", "border-b", 3, "ngClass"], [1, "flex", "items-center", "gap-3"], [1, "p-2.5", "rounded-lg", 3, "ngClass"], ["fill", "none", "stroke", "currentColor", "viewBox", "0 0 24 24", 1, "w-5", "h-5"], ["stroke-linecap", "round", "stroke-linejoin", "round", "stroke-width", "2", "d", "M9 12l2 2 4-4M7.835 4.697a3.42 3.42 0 001.946-.806 3.42 3.42 0 014.438 0 3.42 3.42 0 001.946.806 3.42 3.42 0 013.138 3.138 3.42 3.42 0 00.806 1.946 3.42 3.42 0 010 4.438 3.42 3.42 0 00-.806 1.946 3.42 3.42 0 01-3.138 3.138 3.42 3.42 0 00-1.946.806 3.42 3.42 0 01-4.438 0 3.42 3.42 0 00-1.946-.806 3.42 3.42 0 01-3.138-3.138 3.42 3.42 0 00-.806-1.946 3.42 3.42 0 010-4.438 3.42 3.42 0 00.806-1.946 3.42 3.42 0 013.138-3.138z"], [1, "text-xl", "font-bold", 3, "ngClass"], [1, "text-sm", "mt-0.5", "flex", "items-center", "gap-2", 3, "ngClass"], [1, "font-semibold"], [1, "inline-flex", "items-center", "gap-1", "px-2", "py-0.5", "text-xs", "font-medium", "rounded-md", "transition-colors", 3, "click", "ngClass"], ["fill", "none", "stroke", "currentColor", "viewBox", "0 0 24 24", 1, "w-3", "h-3"], ["stroke-linecap", "round", "stroke-linejoin", "round", "stroke-width", "2", "d", "M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"], [1, "p-8", 3, "ngClass"], [3, "periodUnitChanged", "viewMode", "selectedPeriodUnit", "isLoading"], [1, "flex", "flex-col", "items-center", "justify-center", "py-16", "space-y-6"], [1, "flex", "flex-col", "gap-8", "mb-32"], [1, "text-center", "py-16", 3, "ngClass"], [3, "viewMode", "size"], [1, "text-base", "font-medium", 3, "ngClass"], [3, "viewMode", "planInfo", "isSelected", "selectedPeriodUnit"], [3, "planSelected", "viewMode", "planInfo", "isSelected", "selectedPeriodUnit"], ["fill", "none", "stroke", "currentColor", "viewBox", "0 0 24 24", 1, "w-16", "h-16", "mx-auto", "mb-4", 3, "ngClass"], ["stroke-linecap", "round", "stroke-linejoin", "round", "stroke-width", "2", "d", "M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"], [1, "text-lg", "font-semibold", 3, "ngClass"], [1, "text-sm", "mt-2", 3, "ngClass"]], template: function PlanSelectionContainerComponent_Template(rf, ctx) { if (rf & 1) {
|
|
87428
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: PlanSelectionContainerComponent, selectors: [["symphiq-plan-selection-container"]], inputs: { viewMode: [1, "viewMode"], selectedCurrency: [1, "selectedCurrency"], planCardInfos: [1, "planCardInfos"], isLoading: [1, "isLoading"], selectedPeriodUnit: [1, "selectedPeriodUnit"] }, outputs: { periodUnitChanged: "periodUnitChanged", planSelected: "planSelected", editCurrency: "editCurrency" }, decls: 22, vars: 12, consts: [[1, "rounded-2xl", "border", "shadow-lg", "overflow-hidden", 3, "ngClass"], [1, "px-6", "py-5", "border-b", 3, "ngClass"], [1, "flex", "items-center", "gap-3"], [1, "p-2.5", "rounded-lg", 3, "ngClass"], ["fill", "none", "stroke", "currentColor", "viewBox", "0 0 24 24", 1, "w-5", "h-5"], ["stroke-linecap", "round", "stroke-linejoin", "round", "stroke-width", "2", "d", "M9 12l2 2 4-4M7.835 4.697a3.42 3.42 0 001.946-.806 3.42 3.42 0 014.438 0 3.42 3.42 0 001.946.806 3.42 3.42 0 013.138 3.138 3.42 3.42 0 00.806 1.946 3.42 3.42 0 010 4.438 3.42 3.42 0 00-.806 1.946 3.42 3.42 0 01-3.138 3.138 3.42 3.42 0 00-1.946.806 3.42 3.42 0 01-4.438 0 3.42 3.42 0 00-1.946-.806 3.42 3.42 0 01-3.138-3.138 3.42 3.42 0 00-.806-1.946 3.42 3.42 0 010-4.438 3.42 3.42 0 00.806-1.946 3.42 3.42 0 013.138-3.138z"], [1, "text-xl", "font-bold", 3, "ngClass"], [1, "text-sm", "mt-0.5", "flex", "items-center", "gap-2", 3, "ngClass"], [1, "font-semibold"], [1, "inline-flex", "items-center", "gap-1", "px-2", "py-0.5", "text-xs", "font-medium", "rounded-md", "transition-colors", 3, "click", "ngClass"], ["fill", "none", "stroke", "currentColor", "viewBox", "0 0 24 24", 1, "w-3", "h-3"], ["stroke-linecap", "round", "stroke-linejoin", "round", "stroke-width", "2", "d", "M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"], [1, "p-8", 3, "ngClass"], [3, "periodUnitChanged", "viewMode", "selectedPeriodUnit", "isLoading"], [1, "flex", "flex-col", "items-center", "justify-center", "py-16", "space-y-6", "min-h-[400px]"], [1, "flex", "flex-col", "gap-8", "mb-32", "min-h-[400px]"], [1, "text-center", "py-16", 3, "ngClass"], [3, "viewMode", "size"], [1, "text-base", "font-medium", 3, "ngClass"], [3, "viewMode", "planInfo", "isSelected", "selectedPeriodUnit"], [3, "planSelected", "viewMode", "planInfo", "isSelected", "selectedPeriodUnit"], ["fill", "none", "stroke", "currentColor", "viewBox", "0 0 24 24", 1, "w-16", "h-16", "mx-auto", "mb-4", 3, "ngClass"], ["stroke-linecap", "round", "stroke-linejoin", "round", "stroke-width", "2", "d", "M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"], [1, "text-lg", "font-semibold", 3, "ngClass"], [1, "text-sm", "mt-2", 3, "ngClass"]], template: function PlanSelectionContainerComponent_Template(rf, ctx) { if (rf & 1) {
|
|
87419
87429
|
i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "div", 2)(3, "div", 3);
|
|
87420
87430
|
i0.ɵɵnamespaceSVG();
|
|
87421
87431
|
i0.ɵɵelementStart(4, "svg", 4);
|
|
@@ -87512,7 +87522,7 @@ class PlanSelectionContainerComponent {
|
|
|
87512
87522
|
/>
|
|
87513
87523
|
|
|
87514
87524
|
@if (isLoading()) {
|
|
87515
|
-
<div class="flex flex-col items-center justify-center py-16 space-y-6">
|
|
87525
|
+
<div class="flex flex-col items-center justify-center py-16 space-y-6 min-h-[400px]">
|
|
87516
87526
|
<symphiq-indeterminate-spinner
|
|
87517
87527
|
[viewMode]="viewMode()"
|
|
87518
87528
|
[size]="'large'"
|
|
@@ -87522,7 +87532,7 @@ class PlanSelectionContainerComponent {
|
|
|
87522
87532
|
</p>
|
|
87523
87533
|
</div>
|
|
87524
87534
|
} @else if (planCardInfos() && planCardInfos()!.length > 0) {
|
|
87525
|
-
<div class="flex flex-col gap-8 mb-32">
|
|
87535
|
+
<div class="flex flex-col gap-8 mb-32 min-h-[400px]">
|
|
87526
87536
|
@for (plan of planCardInfos(); track plan.planItemPrice.id) {
|
|
87527
87537
|
<symphiq-plan-card
|
|
87528
87538
|
[viewMode]="viewMode()"
|
|
@@ -88869,6 +88879,7 @@ class SymphiqProfileAnalysisDashboardComponent {
|
|
|
88869
88879
|
this.isCurrencySelectionLoading = signal(false, ...(ngDevMode ? [{ debugName: "isCurrencySelectionLoading" }] : []));
|
|
88870
88880
|
this.selectedCurrency = signal(null, ...(ngDevMode ? [{ debugName: "selectedCurrency" }] : []));
|
|
88871
88881
|
this.isPlanLoading = signal(false, ...(ngDevMode ? [{ debugName: "isPlanLoading" }] : []));
|
|
88882
|
+
this.planLoadingStartTime = signal(0, ...(ngDevMode ? [{ debugName: "planLoadingStartTime" }] : []));
|
|
88872
88883
|
this.isEditingCurrency = signal(false, ...(ngDevMode ? [{ debugName: "isEditingCurrency" }] : []));
|
|
88873
88884
|
this.editingCurrencySelection = signal(null, ...(ngDevMode ? [{ debugName: "editingCurrencySelection" }] : []));
|
|
88874
88885
|
this.selectedPeriodUnit = computed(() => {
|
|
@@ -88913,7 +88924,17 @@ class SymphiqProfileAnalysisDashboardComponent {
|
|
|
88913
88924
|
const planCardInfos = this.planCardInfos();
|
|
88914
88925
|
const isLoading = untracked(() => this.isPlanLoading());
|
|
88915
88926
|
if (planCardInfos && isLoading) {
|
|
88916
|
-
this.
|
|
88927
|
+
const startTime = untracked(() => this.planLoadingStartTime());
|
|
88928
|
+
const elapsed = Date.now() - startTime;
|
|
88929
|
+
const minDelay = 300;
|
|
88930
|
+
if (elapsed >= minDelay) {
|
|
88931
|
+
this.isPlanLoading.set(false);
|
|
88932
|
+
}
|
|
88933
|
+
else {
|
|
88934
|
+
setTimeout(() => {
|
|
88935
|
+
this.isPlanLoading.set(false);
|
|
88936
|
+
}, minDelay - elapsed);
|
|
88937
|
+
}
|
|
88917
88938
|
}
|
|
88918
88939
|
}, ...(ngDevMode ? [{ debugName: "planLoadingEffect" }] : []));
|
|
88919
88940
|
this.embeddedScrollEffect = effect(() => {
|
|
@@ -89636,6 +89657,7 @@ class SymphiqProfileAnalysisDashboardComponent {
|
|
|
89636
89657
|
}
|
|
89637
89658
|
}
|
|
89638
89659
|
handlePeriodUnitChange(periodUnit) {
|
|
89660
|
+
this.planLoadingStartTime.set(Date.now());
|
|
89639
89661
|
this.isPlanLoading.set(true);
|
|
89640
89662
|
this.periodUnitChanged.emit(periodUnit);
|
|
89641
89663
|
}
|