@nuskin/react-mysite-elements 1.5.0-ui-fixes.6 → 1.5.0-ui-fixes.8
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/hooks/useProductOfferWidgetExports.d.ts +15 -0
- package/dist/common/shopping-dashboard/index.d.ts +3 -0
- package/dist/common/shopping-dashboard/specs/excelExport.spec.d.ts +1 -0
- package/dist/common/shopping-dashboard/specs/productOfferExport.spec.d.ts +1 -0
- package/dist/common/shopping-dashboard/specs/useProductOfferWidgetExports.spec.d.ts +1 -0
- package/dist/common/shopping-dashboard/utils/excelExport.d.ts +14 -0
- package/dist/common/shopping-dashboard/utils/productOfferExport.d.ts +3 -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 +3 -2
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { TopPerformingOffer, TopProduct } from '../types.d';
|
|
2
|
+
export interface ProductOfferWidgetExportOptions {
|
|
3
|
+
readonly topProducts: readonly TopProduct[];
|
|
4
|
+
readonly topOffers: readonly TopPerformingOffer[];
|
|
5
|
+
readonly topProductsExportData?: readonly TopProduct[];
|
|
6
|
+
readonly topOffersExportData?: readonly TopPerformingOffer[];
|
|
7
|
+
readonly showTopProductsExportOption?: boolean;
|
|
8
|
+
readonly showTopOffersExportOption?: boolean;
|
|
9
|
+
readonly isLoading?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface ProductOfferWidgetExportHandlers {
|
|
12
|
+
readonly onTopProductsExport?: () => Promise<void>;
|
|
13
|
+
readonly onTopOffersExport?: () => Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
export declare function useProductOfferWidgetExports({ topProducts, topOffers, topProductsExportData, topOffersExportData, showTopProductsExportOption, showTopOffersExportOption, isLoading, }: ProductOfferWidgetExportOptions): ProductOfferWidgetExportHandlers;
|
|
@@ -40,3 +40,6 @@ export { formatDateRangeLabel, formatShortDate, formatDisplayDate, formatDateRan
|
|
|
40
40
|
export { DAYS_MAP, DATE_RANGE_LABELS, getDaysFromDateRange, getDateRangeLabel } from './utils/dateConstants';
|
|
41
41
|
export { calculateTotalPages, paginateItems, sortByNumericProperty, calculatePercentage } from './utils/dataUtils';
|
|
42
42
|
export { buildDefaultMarketOptions, resolveMarketOptions } from './utils/marketOptions';
|
|
43
|
+
export { useProductOfferWidgetExports } from './hooks/useProductOfferWidgetExports';
|
|
44
|
+
export { exportRowsToExcel, normalizeExcelFileName, normalizeExcelSheetName } from './utils/excelExport';
|
|
45
|
+
export { exportTopPerformingOffers, exportTopProducts } from './utils/productOfferExport';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type ExcelCellValue = string | number | boolean | Date | null | undefined;
|
|
2
|
+
export interface ExcelExportColumn<TItem> {
|
|
3
|
+
readonly header: string;
|
|
4
|
+
readonly value: (item: TItem) => ExcelCellValue;
|
|
5
|
+
}
|
|
6
|
+
export interface ExcelExportOptions<TItem> {
|
|
7
|
+
readonly rows: readonly TItem[];
|
|
8
|
+
readonly columns: readonly ExcelExportColumn<TItem>[];
|
|
9
|
+
readonly fileName: string;
|
|
10
|
+
readonly sheetName: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function normalizeExcelFileName(fileName: string): string;
|
|
13
|
+
export declare function normalizeExcelSheetName(sheetName: string): string;
|
|
14
|
+
export declare function exportRowsToExcel<TItem>({ rows, columns, fileName, sheetName, }: ExcelExportOptions<TItem>): Promise<void>;
|