@nuskin/react-mysite-elements 1.6.0-comx-2229.11 → 1.6.0-comx-2229.13
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/dist/common/shopping-dashboard/TranslationKeys/ShoppingDashboardTranslationKeys.d.ts +4 -0
- package/dist/common/shopping-dashboard/shared/TopProducts/ProductsFullView.d.ts +1 -0
- package/dist/common/shopping-dashboard/utils/dataUtils.d.ts +11 -6
- package/dist/common/shopping-dashboard/utils/trendUtils.d.ts +20 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -2
package/dist/common/shopping-dashboard/TranslationKeys/ShoppingDashboardTranslationKeys.d.ts
CHANGED
|
@@ -472,6 +472,10 @@ export declare const ShoppingDashboardTranslationKeys: {
|
|
|
472
472
|
readonly key: "shoppingDashboard.defaults.zeroTrend";
|
|
473
473
|
readonly fallback: "+0%";
|
|
474
474
|
};
|
|
475
|
+
readonly labelValueSeparator: {
|
|
476
|
+
readonly key: "shoppingDashboard.defaults.labelValueSeparator";
|
|
477
|
+
readonly fallback: ":";
|
|
478
|
+
};
|
|
475
479
|
readonly noValue: {
|
|
476
480
|
readonly key: "shoppingDashboard.defaults.noValue";
|
|
477
481
|
readonly fallback: "--";
|
|
@@ -7,6 +7,7 @@ export interface ProductsFullViewProps {
|
|
|
7
7
|
readonly productSort: ProductSortOption;
|
|
8
8
|
readonly markets?: ReadonlyArray<MarketFilterOption>;
|
|
9
9
|
readonly isLoading?: boolean;
|
|
10
|
+
readonly currencyCode?: string;
|
|
10
11
|
readonly onBack?: () => void;
|
|
11
12
|
readonly onDateRangeChange?: (range: DateRangeOption) => void;
|
|
12
13
|
readonly onMarketChange?: (market: MarketOption) => void;
|
|
@@ -25,13 +25,18 @@ export declare function usePaginatedItems<T>(items: T[], currentPage: number, it
|
|
|
25
25
|
*/
|
|
26
26
|
export declare function getLocaleFromMarketCode(marketCode?: string): string;
|
|
27
27
|
/**
|
|
28
|
-
* Formats a monetary amount
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
28
|
+
* Formats a monetary amount with currency code displayed as text prefix.
|
|
29
|
+
* Examples:
|
|
30
|
+
* - formatMoney(6701.12, 'AUD') → "AUD 6,701.12"
|
|
31
|
+
* - formatMoney(6701.12, 'USD') → "USD 6,701.12"
|
|
32
|
+
* - formatMoney(6701.12, 'INR') → "INR 6,701.12"
|
|
33
|
+
*
|
|
34
|
+
* @param value - The monetary amount
|
|
35
|
+
* @param currencyCode - ISO 4217 currency code (e.g., 'USD', 'AUD', 'INR')
|
|
36
|
+
* @param minimumFractionDigits - Minimum decimal places (default: 2)
|
|
37
|
+
* @returns Formatted currency string with code as text prefix
|
|
33
38
|
*/
|
|
34
|
-
export declare function formatMoney(value: number, currencyCode?: string): string;
|
|
39
|
+
export declare function formatMoney(value: number, currencyCode?: string, minimumFractionDigits?: number): string;
|
|
35
40
|
export declare function capitalizeFirstLetter(text: string): string;
|
|
36
41
|
/**
|
|
37
42
|
* Gets the numeric value from a SignupDataPoint based on the selected signup view.
|
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { TrendDirection } from '../shared/types';
|
|
3
|
+
/**
|
|
4
|
+
* Shared threshold below which a percentage change is treated as "no meaningful change"
|
|
5
|
+
* and rendered as a neutral trend rather than a misleading +/-0.0x% up/down arrow.
|
|
6
|
+
*/
|
|
7
|
+
export declare const TREND_NEUTRAL_THRESHOLD = 0.1;
|
|
8
|
+
export interface ConversionTrendPoint {
|
|
9
|
+
readonly rate: number;
|
|
10
|
+
}
|
|
11
|
+
export interface ConversionTrendResult {
|
|
12
|
+
readonly direction: TrendDirection;
|
|
13
|
+
readonly value: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Computes the conversion-rate trend shown in both the widget chart and its full-view
|
|
17
|
+
* counterpart. Prefers the API-supplied summaryChangePct when present; otherwise derives
|
|
18
|
+
* the change from the first and last points of the filtered series. The neutral threshold
|
|
19
|
+
* is applied consistently in every branch so backend-provided and locally-computed trends
|
|
20
|
+
* never diverge on what counts as "no change".
|
|
21
|
+
*/
|
|
22
|
+
export declare function computeConversionTrend(summaryChangePct: number | null | undefined, filteredData: readonly ConversionTrendPoint[], noChangeText: string, noDataText?: string): ConversionTrendResult;
|
|
3
23
|
export declare function parseTrendPercent(value?: string | number): number | null;
|
|
4
24
|
export declare function resolveTrendDirection(value?: string | number): TrendDirection;
|
|
5
25
|
export declare function calculateWeightedRevenueTrend<T>(items: readonly T[], getRevenue: (item: T) => number, getTrend: (item: T) => string | number | undefined): {
|