@gem-sdk/analytics 1.0.2-dev.1 → 1.0.2-dev.3
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/esm/components/OrderAnalytic/OrderListingLatestTable.d.ts +1 -1
- package/dist/esm/components/OrderAnalytic/components/OrderListing/OrderListingTable.d.ts +1 -1
- package/dist/esm/core/gemxql/types/extra-condition.d.ts +8 -2
- package/dist/esm/gemxql.js +7 -0
- package/dist/esm/gemxql.mjs +7 -0
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.js +281 -272
- package/dist/esm/index.mjs +281 -272
- package/dist/esm/shared/journey/ui/JourneyTitle/constants/idBadge.d.ts +1 -0
- package/dist/esm/shared/journey/ui/JourneyTitle/constants/index.d.ts +1 -0
- package/dist/esm/shared/reports/ui/ReportTable/ReportTable.d.ts +4 -4
- package/dist/esm/shared/reports/ui/ReportTable/components/Body/Cell/CampaignsCell/CampaignsCell.d.ts +1 -1
- package/dist/esm/shared/reports/ui/ReportTable/components/Body/Cell/Cell.d.ts +3 -2
- package/dist/esm/shared/reports/ui/ReportTable/components/Body/Cell/OrderIdCell.d.ts +1 -1
- package/dist/esm/shared/reports/ui/ReportTable/components/Body/Cell/type.d.ts +2 -1
- package/dist/esm/shared/reports/ui/ReportTable/components/Body/Row.d.ts +1 -1
- package/dist/esm/shared/reports/ui/ReportTable/context/ReportTableActionsContext.d.ts +1 -1
- package/dist/esm/shared/reports/ui/ReportTable/types/index.d.ts +1 -0
- package/dist/style.css +1 -1
- package/dist/umd/esm/components/OrderAnalytic/OrderListingLatestTable.d.ts +1 -1
- package/dist/umd/esm/components/OrderAnalytic/components/OrderListing/OrderListingTable.d.ts +1 -1
- package/dist/umd/esm/core/gemxql/types/extra-condition.d.ts +8 -2
- package/dist/umd/esm/index.d.ts +3 -0
- package/dist/umd/esm/shared/journey/ui/JourneyTitle/constants/idBadge.d.ts +1 -0
- package/dist/umd/esm/shared/journey/ui/JourneyTitle/constants/index.d.ts +1 -0
- package/dist/umd/esm/shared/reports/ui/ReportTable/ReportTable.d.ts +4 -4
- package/dist/umd/esm/shared/reports/ui/ReportTable/components/Body/Cell/CampaignsCell/CampaignsCell.d.ts +1 -1
- package/dist/umd/esm/shared/reports/ui/ReportTable/components/Body/Cell/Cell.d.ts +3 -2
- package/dist/umd/esm/shared/reports/ui/ReportTable/components/Body/Cell/OrderIdCell.d.ts +1 -1
- package/dist/umd/esm/shared/reports/ui/ReportTable/components/Body/Cell/type.d.ts +2 -1
- package/dist/umd/esm/shared/reports/ui/ReportTable/components/Body/Row.d.ts +1 -1
- package/dist/umd/esm/shared/reports/ui/ReportTable/context/ReportTableActionsContext.d.ts +1 -1
- package/dist/umd/esm/shared/reports/ui/ReportTable/types/index.d.ts +1 -0
- package/dist/umd/gemxql.js +1 -1
- package/dist/umd/index.js +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -2058,6 +2058,7 @@ var EComparisonOperator;
|
|
|
2058
2058
|
EComparisonOperator["EQ"] = "=";
|
|
2059
2059
|
EComparisonOperator["IN"] = "IN";
|
|
2060
2060
|
EComparisonOperator["LIKE"] = "LIKE";
|
|
2061
|
+
EComparisonOperator["GROUP"] = "GROUP";
|
|
2061
2062
|
})(EComparisonOperator || (EComparisonOperator = {}));
|
|
2062
2063
|
var EGroupOperator;
|
|
2063
2064
|
(function (EGroupOperator) {
|
|
@@ -23053,110 +23054,6 @@ const CardJourneyAnalysis = ({ analyticMode, config, ...props }) => {
|
|
|
23053
23054
|
return (jsx(PathAnalysisConfigProvider, { ...config, children: jsx(CardPathAnalysis, { analyticMode: analyticMode || EAnalyticMode.ALL_SESSION, ...props, children: jsx(InlineStack, { gap: "200", children: jsx(GTooltipCard, { tooltip: ANALYTICS_METRIC_TOOLTIP[EMetricKey.PAGE_PATH_ANALYSIS], children: jsx(Text, { as: "h3", variant: "headingMd", children: t('Journey analysis') }) }) }) }) }));
|
|
23054
23055
|
};
|
|
23055
23056
|
|
|
23056
|
-
var EDimensionKey;
|
|
23057
|
-
(function (EDimensionKey) {
|
|
23058
|
-
EDimensionKey["TIME"] = "time";
|
|
23059
|
-
EDimensionKey["EXPERIMENT_ID"] = "experiment_id";
|
|
23060
|
-
EDimensionKey["VERSION"] = "version";
|
|
23061
|
-
EDimensionKey["VISITOR"] = "visitor_type";
|
|
23062
|
-
EDimensionKey["TRAFFIC_SOURCE"] = "traffic_source";
|
|
23063
|
-
EDimensionKey["DEVICE"] = "device";
|
|
23064
|
-
})(EDimensionKey || (EDimensionKey = {}));
|
|
23065
|
-
|
|
23066
|
-
var ETooltipCategory;
|
|
23067
|
-
(function (ETooltipCategory) {
|
|
23068
|
-
ETooltipCategory["ALPHABETICAL"] = "ALPHABETICAL";
|
|
23069
|
-
ETooltipCategory["NUMERIC"] = "NUMERIC";
|
|
23070
|
-
ETooltipCategory["DATE"] = "DATE";
|
|
23071
|
-
})(ETooltipCategory || (ETooltipCategory = {}));
|
|
23072
|
-
const TooltipPresets = {
|
|
23073
|
-
[ETooltipCategory.ALPHABETICAL]: { ASC: 'A-Z', DESC: 'Z-A' },
|
|
23074
|
-
[ETooltipCategory.NUMERIC]: { ASC: 'Lowest first', DESC: 'Highest first' },
|
|
23075
|
-
[ETooltipCategory.DATE]: { ASC: 'Oldest first', DESC: 'Newest first' },
|
|
23076
|
-
};
|
|
23077
|
-
const DEFAULT_TOOLTIP = TooltipPresets[ETooltipCategory.NUMERIC];
|
|
23078
|
-
const reportOrderTooltip = {
|
|
23079
|
-
day: TooltipPresets[ETooltipCategory.DATE],
|
|
23080
|
-
order_date: TooltipPresets[ETooltipCategory.DATE],
|
|
23081
|
-
month: TooltipPresets[ETooltipCategory.DATE],
|
|
23082
|
-
year: TooltipPresets[ETooltipCategory.DATE],
|
|
23083
|
-
hour: TooltipPresets[ETooltipCategory.DATE],
|
|
23084
|
-
quarter: TooltipPresets[ETooltipCategory.DATE],
|
|
23085
|
-
week: TooltipPresets[ETooltipCategory.DATE],
|
|
23086
|
-
[EDimensionKey.DEVICE]: TooltipPresets[ETooltipCategory.ALPHABETICAL],
|
|
23087
|
-
[EDimensionKey.VISITOR]: TooltipPresets[ETooltipCategory.ALPHABETICAL],
|
|
23088
|
-
[EDimensionKey.VERSION]: TooltipPresets[ETooltipCategory.ALPHABETICAL],
|
|
23089
|
-
[EDimensionKey.TRAFFIC_SOURCE]: TooltipPresets[ETooltipCategory.ALPHABETICAL],
|
|
23090
|
-
};
|
|
23091
|
-
|
|
23092
|
-
const DEFAULT_DIMENSION_LAYOUT = {
|
|
23093
|
-
width: '200px',
|
|
23094
|
-
minWidth: '200px',
|
|
23095
|
-
align: 'start',
|
|
23096
|
-
paddingRight: '28px',
|
|
23097
|
-
headerPaddingRight: '0',
|
|
23098
|
-
};
|
|
23099
|
-
const DEFAULT_METRIC_LAYOUT = {
|
|
23100
|
-
minWidth: '140px',
|
|
23101
|
-
align: 'end',
|
|
23102
|
-
paddingRight: '28px',
|
|
23103
|
-
headerPaddingRight: '0',
|
|
23104
|
-
};
|
|
23105
|
-
const IS_TOTAL_ROW_FIELD = 'isTotalRow';
|
|
23106
|
-
|
|
23107
|
-
const ReportTableActionsContext = createContext({});
|
|
23108
|
-
const ReportTableActionsProvider = ({ children, onViewOrderJourney, onViewOrderDetails, onViewAllStoreOrders, }) => {
|
|
23109
|
-
return (jsx(ReportTableActionsContext.Provider, { value: { onViewOrderJourney, onViewOrderDetails, onViewAllStoreOrders }, children: children }));
|
|
23110
|
-
};
|
|
23111
|
-
const useReportTableActionsContext = () => useContext(ReportTableActionsContext);
|
|
23112
|
-
|
|
23113
|
-
var GEMX_LOGO = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzgiIGhlaWdodD0iNDIiIHZpZXdCb3g9IjAgMCAzOCA0MiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwXzM4MzQzXzMwMTI3KSI+CjxwYXRoIGQ9Ik0yMi43Nzc4IDEuODk4NjdMMTkuNTU5IDcuNzcyMDZDMTkuNTMyNCA3LjgyNDYyIDE5LjUzMjQgNy44OTAzMiAxOS41NTkgNy45NDI4OEwyNi40NjIyIDIwLjU0MzdDMjYuNTI4NyAyMC42Njg2IDI2LjcwODMgMjAuNjY4NiAyNi43NzQ4IDIwLjU0MzdMMzcuODg3NyAwLjI2Mjc5MkMzNy45NTQyIDAuMTQ0NTM1IDM3Ljg2NzggMCAzNy43MjgxIDBIMjYuMDAzM0MyNC42NTMzIDAgMjMuNDE2MyAwLjcyOTI0NyAyMi43Nzc4IDEuODk4NjdaIiBmaWxsPSIjQ0NDQ0NDIi8+CjxwYXRoIGQ9Ik0xMi4zODI5IDBIMC40NTE5OTVDMC4xMTI4MjEgMCAtMC4xMDY2NDUgMC4zNjEzMzggMC4wNTk2MTY4IDAuNjU2OTc5TDExLjA5OTQgMjAuODEzMUwwLjA1Mjk2NjMgNDAuOTgyNEMtMC4xMDY2NDUgNDEuMjc4IDAuMTA2MTcgNDEuNjM5MyAwLjQ1MTk5NSA0MS42MzkzSDEyLjM1NjNDMTIuNjIyNCA0MS42MzkzIDEyLjg3NTEgNDEuNDk0OCAxMy4wMDE0IDQxLjI1ODNMMjQuMDQxMiAyMS4xMDIyQzI0LjE0NzYgMjAuOTExNiAyNC4xNDc2IDIwLjY3NTEgMjQuMDQxMiAyMC40ODQ2TDEzLjAyOCAwLjM4MTA0OEMxMi45MDE3IDAuMTQ0NTM1IDEyLjY1NTYgMCAxMi4zODI5IDBaIiBmaWxsPSIjQ0NDQ0NDIi8+CjxwYXRoIGQ9Ik0yMi43Nzc4IDM5Ljc5OTdMMTkuNTU5IDMzLjkyNjNDMTkuNTMyNCAzMy44NzM4IDE5LjUzMjQgMzMuODA4MSAxOS41NTkgMzMuNzU1NUwyNi40NjIyIDIxLjE1NDdDMjYuNTI4NyAyMS4wMjk4IDI2LjcwODMgMjEuMDI5OCAyNi43NzQ4IDIxLjE1NDdMMzcuODgxMSA0MS40MzU2QzM3Ljk0NzYgNDEuNTUzOSAzNy44NjExIDQxLjY5ODQgMzcuNzIxNSA0MS42OTg0SDI1Ljk5NjdDMjQuNjQ2NiA0MS42OTg0IDIzLjQwOTYgNDAuOTY5MSAyMi43NzEyIDM5Ljc5OTdIMjIuNzc3OFoiIGZpbGw9IiNDQ0NDQ0MiLz4KPC9nPgo8ZGVmcz4KPGNsaXBQYXRoIGlkPSJjbGlwMF8zODM0M18zMDEyNyI+CjxyZWN0IHdpZHRoPSIzNy45MDc3IiBoZWlnaHQ9IjQxLjY5ODUiIGZpbGw9IndoaXRlIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg==";
|
|
23114
|
-
|
|
23115
|
-
const getColumnLayoutStyles = (columnLayout, hasTooltipCard) => {
|
|
23116
|
-
return {
|
|
23117
|
-
'--column-cell-min-width': columnLayout.minWidth,
|
|
23118
|
-
'--column-cell-max-width': columnLayout.maxWidth,
|
|
23119
|
-
'--column-cell-justify-content': columnLayout.align,
|
|
23120
|
-
'--column-cell-padding-inline': columnLayout.paddingInline,
|
|
23121
|
-
'--column-first-padding-inline': columnLayout.columnFirstPaddingInline,
|
|
23122
|
-
'--column-wrapper-width': columnLayout.columnWrapperWidth,
|
|
23123
|
-
'--column-cell-padding-right': !hasTooltipCard ? columnLayout.paddingRight : columnLayout.paddingInline,
|
|
23124
|
-
'--column-header-cell-padding-right': !hasTooltipCard
|
|
23125
|
-
? columnLayout.headerPaddingRight
|
|
23126
|
-
: columnLayout.paddingInline,
|
|
23127
|
-
'--column-dimension-box-shadow': columnLayout.dimensionBoxShadow,
|
|
23128
|
-
'--column-border-right-width': columnLayout.borderRightWidth,
|
|
23129
|
-
};
|
|
23130
|
-
};
|
|
23131
|
-
|
|
23132
|
-
var EOrderDirectionType;
|
|
23133
|
-
(function (EOrderDirectionType) {
|
|
23134
|
-
EOrderDirectionType["ASC"] = "ASC";
|
|
23135
|
-
EOrderDirectionType["DESC"] = "DESC";
|
|
23136
|
-
})(EOrderDirectionType || (EOrderDirectionType = {}));
|
|
23137
|
-
|
|
23138
|
-
const formatReportTableDate = (dateString) => {
|
|
23139
|
-
if (!dateString)
|
|
23140
|
-
return 'None';
|
|
23141
|
-
const date = dayjsTz(dateString);
|
|
23142
|
-
const now = dayjsTz();
|
|
23143
|
-
const yesterday = dayjsTz().subtract(1, 'day');
|
|
23144
|
-
const isToday = date.format('YYYY-MM-DD') === now.format('YYYY-MM-DD');
|
|
23145
|
-
const isYesterday = date.format('YYYY-MM-DD') === yesterday.format('YYYY-MM-DD');
|
|
23146
|
-
if (isToday) {
|
|
23147
|
-
return `Today at ${date.format('HH:mm')}`;
|
|
23148
|
-
}
|
|
23149
|
-
if (isYesterday) {
|
|
23150
|
-
return `Yesterday at ${date.format('HH:mm')}`;
|
|
23151
|
-
}
|
|
23152
|
-
const daysDiff = now.diff(date, 'day');
|
|
23153
|
-
const isWithinWeek = daysDiff >= 0 && daysDiff < 7;
|
|
23154
|
-
if (isWithinWeek) {
|
|
23155
|
-
return `${date.format('dddd')} at ${date.format('HH:mm')}`;
|
|
23156
|
-
}
|
|
23157
|
-
return `${date.format('MMM D')} at ${date.format('hh:mm a')}`;
|
|
23158
|
-
};
|
|
23159
|
-
|
|
23160
23057
|
var EReportDataType;
|
|
23161
23058
|
(function (EReportDataType) {
|
|
23162
23059
|
EReportDataType["DATE"] = "DATE";
|
|
@@ -23211,91 +23108,6 @@ var IRMetricKey;
|
|
|
23211
23108
|
IRMetricKey["VISITOR_BY_TYPE"] = "visitor_type";
|
|
23212
23109
|
})(IRMetricKey || (IRMetricKey = {}));
|
|
23213
23110
|
|
|
23214
|
-
const formatReportData = ({ value, formatter, getTextPrice, name, }) => {
|
|
23215
|
-
const dataTypeIsObjectOrArray = value !== null && (typeof value === 'object' || Array.isArray(value));
|
|
23216
|
-
if (dataTypeIsObjectOrArray)
|
|
23217
|
-
return value;
|
|
23218
|
-
switch (formatter) {
|
|
23219
|
-
case EReportDataType.INTEGER: {
|
|
23220
|
-
return numberWithCommas((value ?? 0).toString());
|
|
23221
|
-
}
|
|
23222
|
-
case EReportDataType.CURRENCY: {
|
|
23223
|
-
return getTextPrice(value, false);
|
|
23224
|
-
}
|
|
23225
|
-
case EReportDataType.DATE: {
|
|
23226
|
-
return formatReportTableDate(value);
|
|
23227
|
-
}
|
|
23228
|
-
case EReportDataType.PERCENT: {
|
|
23229
|
-
if (typeof value !== 'number')
|
|
23230
|
-
return calcPercentageString(0, 1, 2) ?? '';
|
|
23231
|
-
return calcPercentageString(value / 100, 1, 2) ?? '';
|
|
23232
|
-
}
|
|
23233
|
-
case EReportDataType.DURATION: {
|
|
23234
|
-
return getTimeDurationLabel(Number(value));
|
|
23235
|
-
}
|
|
23236
|
-
case EReportDataType.STRING: {
|
|
23237
|
-
const fallbackValue = name === EReportColumnKey.CAMPAIGNS ? '' : NONE_VALUE;
|
|
23238
|
-
return value ?? fallbackValue;
|
|
23239
|
-
}
|
|
23240
|
-
case EReportDataType.DAY: {
|
|
23241
|
-
return getFormattedByInterval(value, AnalyticInterval.DAY, {
|
|
23242
|
-
isExpandDetail: true,
|
|
23243
|
-
});
|
|
23244
|
-
}
|
|
23245
|
-
case EReportDataType.HOUR: {
|
|
23246
|
-
return getFormattedByInterval(value, AnalyticInterval.HOUR, {
|
|
23247
|
-
isExpandDetail: true,
|
|
23248
|
-
});
|
|
23249
|
-
}
|
|
23250
|
-
case EReportDataType.MONTH: {
|
|
23251
|
-
return getFormattedByInterval(value, AnalyticInterval.MONTH, {
|
|
23252
|
-
isExpandDetail: true,
|
|
23253
|
-
});
|
|
23254
|
-
}
|
|
23255
|
-
case EReportDataType.YEAR: {
|
|
23256
|
-
return getFormattedByInterval(value, AnalyticInterval.YEAR);
|
|
23257
|
-
}
|
|
23258
|
-
case EReportDataType.WEEK: {
|
|
23259
|
-
return getFormattedByInterval(value, AnalyticInterval.WEEK, {
|
|
23260
|
-
isExpandDetail: true,
|
|
23261
|
-
});
|
|
23262
|
-
}
|
|
23263
|
-
case EReportDataType.QUARTER: {
|
|
23264
|
-
return getFormattedByInterval(value, AnalyticInterval.QUARTER, {
|
|
23265
|
-
isExpandDetail: true,
|
|
23266
|
-
});
|
|
23267
|
-
}
|
|
23268
|
-
case EReportDataType.OBJECT:
|
|
23269
|
-
case EReportDataType.ARRAY: {
|
|
23270
|
-
return value;
|
|
23271
|
-
}
|
|
23272
|
-
default:
|
|
23273
|
-
return `${value}`;
|
|
23274
|
-
}
|
|
23275
|
-
};
|
|
23276
|
-
|
|
23277
|
-
const COLOR_NORMAL = '#FFFFFF';
|
|
23278
|
-
const COLOR_ACTIVE = '#F8F8F8';
|
|
23279
|
-
const ReportTableSkeleton = ({ rows = 3, columns = 2, startBackgroundColor = 'normal', hiddenPagination = true, showLogo = false, }) => {
|
|
23280
|
-
const colors = startBackgroundColor === 'normal' ? [COLOR_NORMAL, COLOR_ACTIVE] : [COLOR_ACTIVE, COLOR_NORMAL];
|
|
23281
|
-
const getRowColor = (index) => colors[index % 2];
|
|
23282
|
-
const getColJustify = (colIndex) => {
|
|
23283
|
-
if (colIndex === 0)
|
|
23284
|
-
return 'start';
|
|
23285
|
-
if (colIndex === columns - 1)
|
|
23286
|
-
return 'end';
|
|
23287
|
-
return 'center';
|
|
23288
|
-
};
|
|
23289
|
-
return (jsxs(Fragment, { children: [jsx("div", { className: cls('GReportTable__Container', {
|
|
23290
|
-
'GReportTable__Container--pagination-hidden': hiddenPagination,
|
|
23291
|
-
}), children: jsx("div", { className: "GReportTable__Wrapper", children: jsx("div", { className: "GReportTable__ScrollWrap", children: Array.from({ length: rows }).map((_, rowIndex) => (jsx("div", { className: "GReportTable__Row", children: Array.from({ length: columns }).map((_, colIndex) => (jsx("div", { className: "GReportTable__Cell !border-r-0 px-5", style: {
|
|
23292
|
-
backgroundColor: getRowColor(rowIndex),
|
|
23293
|
-
...getColumnLayoutStyles({
|
|
23294
|
-
align: getColJustify(colIndex),
|
|
23295
|
-
}),
|
|
23296
|
-
}, children: jsx(Box, { width: "92px", children: jsx(SkeletonBodyText, { lines: 1 }) }) }, colIndex))) }, rowIndex))) }) }) }), showLogo && (jsx(GInlineCenter, { align: "center", inlineAlign: "center", minHeight: "320px", children: jsx("img", { src: GEMX_LOGO, alt: "Gemx", width: 38, height: 42 }) }))] }));
|
|
23297
|
-
};
|
|
23298
|
-
|
|
23299
23111
|
[IRVariantType.VARIANT_A, IRVariantType.VARIANT_B];
|
|
23300
23112
|
({
|
|
23301
23113
|
[IRVariantType.VARIANT_A]: 'Control',
|
|
@@ -23329,6 +23141,57 @@ function getMetricPreviousValue(row, key) {
|
|
|
23329
23141
|
return row[getPreviousColumnName(key)];
|
|
23330
23142
|
}
|
|
23331
23143
|
|
|
23144
|
+
var EDimensionKey;
|
|
23145
|
+
(function (EDimensionKey) {
|
|
23146
|
+
EDimensionKey["TIME"] = "time";
|
|
23147
|
+
EDimensionKey["EXPERIMENT_ID"] = "experiment_id";
|
|
23148
|
+
EDimensionKey["VERSION"] = "version";
|
|
23149
|
+
EDimensionKey["VISITOR"] = "visitor_type";
|
|
23150
|
+
EDimensionKey["TRAFFIC_SOURCE"] = "traffic_source";
|
|
23151
|
+
EDimensionKey["DEVICE"] = "device";
|
|
23152
|
+
})(EDimensionKey || (EDimensionKey = {}));
|
|
23153
|
+
|
|
23154
|
+
var ETooltipCategory;
|
|
23155
|
+
(function (ETooltipCategory) {
|
|
23156
|
+
ETooltipCategory["ALPHABETICAL"] = "ALPHABETICAL";
|
|
23157
|
+
ETooltipCategory["NUMERIC"] = "NUMERIC";
|
|
23158
|
+
ETooltipCategory["DATE"] = "DATE";
|
|
23159
|
+
})(ETooltipCategory || (ETooltipCategory = {}));
|
|
23160
|
+
const TooltipPresets = {
|
|
23161
|
+
[ETooltipCategory.ALPHABETICAL]: { ASC: 'A-Z', DESC: 'Z-A' },
|
|
23162
|
+
[ETooltipCategory.NUMERIC]: { ASC: 'Lowest first', DESC: 'Highest first' },
|
|
23163
|
+
[ETooltipCategory.DATE]: { ASC: 'Oldest first', DESC: 'Newest first' },
|
|
23164
|
+
};
|
|
23165
|
+
const DEFAULT_TOOLTIP = TooltipPresets[ETooltipCategory.NUMERIC];
|
|
23166
|
+
const reportOrderTooltip = {
|
|
23167
|
+
day: TooltipPresets[ETooltipCategory.DATE],
|
|
23168
|
+
order_date: TooltipPresets[ETooltipCategory.DATE],
|
|
23169
|
+
month: TooltipPresets[ETooltipCategory.DATE],
|
|
23170
|
+
year: TooltipPresets[ETooltipCategory.DATE],
|
|
23171
|
+
hour: TooltipPresets[ETooltipCategory.DATE],
|
|
23172
|
+
quarter: TooltipPresets[ETooltipCategory.DATE],
|
|
23173
|
+
week: TooltipPresets[ETooltipCategory.DATE],
|
|
23174
|
+
[EDimensionKey.DEVICE]: TooltipPresets[ETooltipCategory.ALPHABETICAL],
|
|
23175
|
+
[EDimensionKey.VISITOR]: TooltipPresets[ETooltipCategory.ALPHABETICAL],
|
|
23176
|
+
[EDimensionKey.VERSION]: TooltipPresets[ETooltipCategory.ALPHABETICAL],
|
|
23177
|
+
[EDimensionKey.TRAFFIC_SOURCE]: TooltipPresets[ETooltipCategory.ALPHABETICAL],
|
|
23178
|
+
};
|
|
23179
|
+
|
|
23180
|
+
const DEFAULT_DIMENSION_LAYOUT = {
|
|
23181
|
+
width: '200px',
|
|
23182
|
+
minWidth: '200px',
|
|
23183
|
+
align: 'start',
|
|
23184
|
+
paddingRight: '28px',
|
|
23185
|
+
headerPaddingRight: '0',
|
|
23186
|
+
};
|
|
23187
|
+
const DEFAULT_METRIC_LAYOUT = {
|
|
23188
|
+
minWidth: '140px',
|
|
23189
|
+
align: 'end',
|
|
23190
|
+
paddingRight: '28px',
|
|
23191
|
+
headerPaddingRight: '0',
|
|
23192
|
+
};
|
|
23193
|
+
const IS_TOTAL_ROW_FIELD = 'isTotalRow';
|
|
23194
|
+
|
|
23332
23195
|
const useReportTable = ({ dimensions, tableData, metrics }) => {
|
|
23333
23196
|
const columnsByName = useMemo(() => {
|
|
23334
23197
|
return tableData.columns.reduce((lookup, column) => {
|
|
@@ -23501,6 +23364,114 @@ const useSyncedScroll = ({ columns }) => {
|
|
|
23501
23364
|
return { headerRef, bodyRef, scrollbarContainerRef, leftShadowRef, rightShadowRef };
|
|
23502
23365
|
};
|
|
23503
23366
|
|
|
23367
|
+
const getColumnLayoutStyles = (columnLayout, hasTooltipCard) => {
|
|
23368
|
+
return {
|
|
23369
|
+
'--column-cell-min-width': columnLayout.minWidth,
|
|
23370
|
+
'--column-cell-max-width': columnLayout.maxWidth,
|
|
23371
|
+
'--column-cell-justify-content': columnLayout.align,
|
|
23372
|
+
'--column-cell-padding-inline': columnLayout.paddingInline,
|
|
23373
|
+
'--column-first-padding-inline': columnLayout.columnFirstPaddingInline,
|
|
23374
|
+
'--column-wrapper-width': columnLayout.columnWrapperWidth,
|
|
23375
|
+
'--column-cell-padding-right': !hasTooltipCard ? columnLayout.paddingRight : columnLayout.paddingInline,
|
|
23376
|
+
'--column-header-cell-padding-right': !hasTooltipCard
|
|
23377
|
+
? columnLayout.headerPaddingRight
|
|
23378
|
+
: columnLayout.paddingInline,
|
|
23379
|
+
'--column-dimension-box-shadow': columnLayout.dimensionBoxShadow,
|
|
23380
|
+
'--column-border-right-width': columnLayout.borderRightWidth,
|
|
23381
|
+
};
|
|
23382
|
+
};
|
|
23383
|
+
|
|
23384
|
+
var EOrderDirectionType;
|
|
23385
|
+
(function (EOrderDirectionType) {
|
|
23386
|
+
EOrderDirectionType["ASC"] = "ASC";
|
|
23387
|
+
EOrderDirectionType["DESC"] = "DESC";
|
|
23388
|
+
})(EOrderDirectionType || (EOrderDirectionType = {}));
|
|
23389
|
+
|
|
23390
|
+
const formatReportTableDate = (dateString) => {
|
|
23391
|
+
if (!dateString)
|
|
23392
|
+
return 'None';
|
|
23393
|
+
const date = dayjsTz(dateString);
|
|
23394
|
+
const now = dayjsTz();
|
|
23395
|
+
const yesterday = dayjsTz().subtract(1, 'day');
|
|
23396
|
+
const isToday = date.format('YYYY-MM-DD') === now.format('YYYY-MM-DD');
|
|
23397
|
+
const isYesterday = date.format('YYYY-MM-DD') === yesterday.format('YYYY-MM-DD');
|
|
23398
|
+
if (isToday) {
|
|
23399
|
+
return `Today at ${date.format('HH:mm')}`;
|
|
23400
|
+
}
|
|
23401
|
+
if (isYesterday) {
|
|
23402
|
+
return `Yesterday at ${date.format('HH:mm')}`;
|
|
23403
|
+
}
|
|
23404
|
+
const daysDiff = now.diff(date, 'day');
|
|
23405
|
+
const isWithinWeek = daysDiff >= 0 && daysDiff < 7;
|
|
23406
|
+
if (isWithinWeek) {
|
|
23407
|
+
return `${date.format('dddd')} at ${date.format('HH:mm')}`;
|
|
23408
|
+
}
|
|
23409
|
+
return `${date.format('MMM D')} at ${date.format('hh:mm a')}`;
|
|
23410
|
+
};
|
|
23411
|
+
|
|
23412
|
+
const formatReportData = ({ value, formatter, getTextPrice, name, }) => {
|
|
23413
|
+
const dataTypeIsObjectOrArray = value !== null && (typeof value === 'object' || Array.isArray(value));
|
|
23414
|
+
if (dataTypeIsObjectOrArray)
|
|
23415
|
+
return value;
|
|
23416
|
+
switch (formatter) {
|
|
23417
|
+
case EReportDataType.INTEGER: {
|
|
23418
|
+
return numberWithCommas((value ?? 0).toString());
|
|
23419
|
+
}
|
|
23420
|
+
case EReportDataType.CURRENCY: {
|
|
23421
|
+
return getTextPrice(value, false);
|
|
23422
|
+
}
|
|
23423
|
+
case EReportDataType.DATE: {
|
|
23424
|
+
return formatReportTableDate(value);
|
|
23425
|
+
}
|
|
23426
|
+
case EReportDataType.PERCENT: {
|
|
23427
|
+
if (typeof value !== 'number')
|
|
23428
|
+
return calcPercentageString(0, 1, 2) ?? '';
|
|
23429
|
+
return calcPercentageString(value / 100, 1, 2) ?? '';
|
|
23430
|
+
}
|
|
23431
|
+
case EReportDataType.DURATION: {
|
|
23432
|
+
return getTimeDurationLabel(Number(value));
|
|
23433
|
+
}
|
|
23434
|
+
case EReportDataType.STRING: {
|
|
23435
|
+
const fallbackValue = name === EReportColumnKey.CAMPAIGNS ? '' : NONE_VALUE;
|
|
23436
|
+
return value ?? fallbackValue;
|
|
23437
|
+
}
|
|
23438
|
+
case EReportDataType.DAY: {
|
|
23439
|
+
return getFormattedByInterval(value, AnalyticInterval.DAY, {
|
|
23440
|
+
isExpandDetail: true,
|
|
23441
|
+
});
|
|
23442
|
+
}
|
|
23443
|
+
case EReportDataType.HOUR: {
|
|
23444
|
+
return getFormattedByInterval(value, AnalyticInterval.HOUR, {
|
|
23445
|
+
isExpandDetail: true,
|
|
23446
|
+
});
|
|
23447
|
+
}
|
|
23448
|
+
case EReportDataType.MONTH: {
|
|
23449
|
+
return getFormattedByInterval(value, AnalyticInterval.MONTH, {
|
|
23450
|
+
isExpandDetail: true,
|
|
23451
|
+
});
|
|
23452
|
+
}
|
|
23453
|
+
case EReportDataType.YEAR: {
|
|
23454
|
+
return getFormattedByInterval(value, AnalyticInterval.YEAR);
|
|
23455
|
+
}
|
|
23456
|
+
case EReportDataType.WEEK: {
|
|
23457
|
+
return getFormattedByInterval(value, AnalyticInterval.WEEK, {
|
|
23458
|
+
isExpandDetail: true,
|
|
23459
|
+
});
|
|
23460
|
+
}
|
|
23461
|
+
case EReportDataType.QUARTER: {
|
|
23462
|
+
return getFormattedByInterval(value, AnalyticInterval.QUARTER, {
|
|
23463
|
+
isExpandDetail: true,
|
|
23464
|
+
});
|
|
23465
|
+
}
|
|
23466
|
+
case EReportDataType.OBJECT:
|
|
23467
|
+
case EReportDataType.ARRAY: {
|
|
23468
|
+
return value;
|
|
23469
|
+
}
|
|
23470
|
+
default:
|
|
23471
|
+
return `${value}`;
|
|
23472
|
+
}
|
|
23473
|
+
};
|
|
23474
|
+
|
|
23504
23475
|
const useReportData = () => {
|
|
23505
23476
|
const { getTextPrice } = useConvertMoneyContext();
|
|
23506
23477
|
const formatData = ({ value, formatter, name, }) => {
|
|
@@ -23516,58 +23487,11 @@ const useReportData = () => {
|
|
|
23516
23487
|
};
|
|
23517
23488
|
};
|
|
23518
23489
|
|
|
23519
|
-
const
|
|
23520
|
-
|
|
23521
|
-
|
|
23522
|
-
const isHasTotalRows = Boolean(totalRows && totalRows > 0);
|
|
23523
|
-
const isHasTotalStoreOrders = Boolean(itemCount && itemCount > 0);
|
|
23524
|
-
const isShowViewAllStoreOrders = isHasTotalStoreOrders && showViewAllButton;
|
|
23525
|
-
const handleClickViewAllStoreOrders = () => {
|
|
23526
|
-
onViewAllStoreOrders?.();
|
|
23527
|
-
};
|
|
23528
|
-
if (isPaginationHidden)
|
|
23529
|
-
return null;
|
|
23530
|
-
return (jsxs("div", { className: cls('GReportTable__Pagination', {
|
|
23531
|
-
'justify-end': isShowViewAllStoreOrders,
|
|
23532
|
-
'justify-center': isHasTotalRows,
|
|
23533
|
-
'justify-between': (isHasTotalRows || paginationProps) && isShowViewAllStoreOrders,
|
|
23534
|
-
}), children: [paginationProps && jsx(GPagination, { ...paginationProps }), isHasTotalRows && (jsx(Text, { variant: "bodyMd", as: "span", children: t('{{count}} rows', { count: totalRows }) })), isShowViewAllStoreOrders && (jsx(GMockDataTooltip, { isMockData: isMockData, children: jsx(Button, { variant: "plain", disabled: isMockData, onClick: handleClickViewAllStoreOrders, children: getViewAllStoreOrdersText() }) }))] }));
|
|
23535
|
-
function getViewAllStoreOrdersText() {
|
|
23536
|
-
if (itemCount && itemCount > 1) {
|
|
23537
|
-
return t('View all store {{metric}}s by date range ({{itemCount}})', {
|
|
23538
|
-
itemCount,
|
|
23539
|
-
metric: viewAllMetricContent,
|
|
23540
|
-
});
|
|
23541
|
-
}
|
|
23542
|
-
return t('View all store {{metric}} by date range(1)', { metric: viewAllMetricContent });
|
|
23543
|
-
}
|
|
23544
|
-
};
|
|
23545
|
-
|
|
23546
|
-
const ScrollBar = forwardRef(({ isPaginationHidden }, ref) => {
|
|
23547
|
-
return (jsx("div", { className: cls('GReportTable__ScrollBarContainer', {
|
|
23548
|
-
'GReportTable__ScrollBarContainer--pagination-hidden': isPaginationHidden,
|
|
23549
|
-
}), ref: ref, children: jsx("div", { className: "GReportTable__ScrollBar", children: jsx("div", { className: "GReportTable__ScrollBarContent" }) }) }));
|
|
23550
|
-
});
|
|
23551
|
-
ScrollBar.displayName = 'ScrollBar';
|
|
23552
|
-
|
|
23553
|
-
const WrapperFooter = ({ scrollbarContainerRef, itemCount, totalPaginationRows, showViewAllButton, paginationProps, isPaginationHidden, isMockData, }) => {
|
|
23554
|
-
return (jsxs("div", { className: "GReportTable__FooterWrapper", children: [scrollbarContainerRef && jsx(ScrollBar, { ref: scrollbarContainerRef, isPaginationHidden: isPaginationHidden }), jsx(Pagination, { totalRows: totalPaginationRows, itemCount: itemCount, showViewAllButton: showViewAllButton, paginationProps: paginationProps, isPaginationHidden: isPaginationHidden, isMockData: isMockData })] }));
|
|
23555
|
-
};
|
|
23556
|
-
|
|
23557
|
-
const PreviousCell = ({ previousValue, isMergedWithPrev }) => {
|
|
23558
|
-
if (isMergedWithPrev || typeof previousValue !== 'string')
|
|
23559
|
-
return null;
|
|
23560
|
-
return (jsx(Text, { as: "span", variant: "bodySm", tone: "subdued", children: previousValue }));
|
|
23561
|
-
};
|
|
23562
|
-
|
|
23563
|
-
const WrapperCell = ({ children, previousValue, isMergedWithPrev, columnLayout, }) => {
|
|
23564
|
-
return (jsxs(GInlineCenter, { flexDirection: "column", align: columnLayout?.align, gap: "100", paddingBlock: "200", width: columnLayout?.columnWrapperWidth, children: [children, jsx(PreviousCell, { previousValue: previousValue, isMergedWithPrev: isMergedWithPrev })] }));
|
|
23565
|
-
};
|
|
23566
|
-
|
|
23567
|
-
const DefaultCell = ({ isMergedWithPrev, value, previousValue, columnLayout, isTotalRow, isDimensionCol, }) => {
|
|
23568
|
-
const valueString = typeof value === 'string' ? value : String(value);
|
|
23569
|
-
return (jsx(WrapperCell, { previousValue: previousValue, isMergedWithPrev: isMergedWithPrev, columnLayout: columnLayout, children: jsx("div", { className: "w-full min-w-0", children: jsx(GTextTruncated, { as: "span", variant: "bodySm", truncate: true, fontWeight: isTotalRow && !isDimensionCol ? 'semibold' : 'regular', alignment: columnLayout?.align, children: isMergedWithPrev ? '' : toCapitalize(valueString) }) }) }));
|
|
23490
|
+
const ReportTableActionsContext = createContext({});
|
|
23491
|
+
const ReportTableActionsProvider = ({ children, onViewOrderJourney, onViewOrderDetails, onViewAllStoreOrders, }) => {
|
|
23492
|
+
return (jsx(ReportTableActionsContext.Provider, { value: { onViewOrderJourney, onViewOrderDetails, onViewAllStoreOrders }, children: children }));
|
|
23570
23493
|
};
|
|
23494
|
+
const useReportTableActionsContext = () => useContext(ReportTableActionsContext);
|
|
23571
23495
|
|
|
23572
23496
|
var GVariantBadgeType;
|
|
23573
23497
|
(function (GVariantBadgeType) {
|
|
@@ -23650,7 +23574,7 @@ const CampaignsCellVersion = ({ version }) => {
|
|
|
23650
23574
|
};
|
|
23651
23575
|
|
|
23652
23576
|
const CampaignsCell = ({ value, campaignsCellProps, }) => {
|
|
23653
|
-
const { orderId, isHideCampaignContent } = campaignsCellProps ?? {};
|
|
23577
|
+
const { orderId, gxId, isHideCampaignContent } = campaignsCellProps ?? {};
|
|
23654
23578
|
const { t } = useTranslation();
|
|
23655
23579
|
const { onViewOrderJourney } = useReportTableActionsContext();
|
|
23656
23580
|
const [active, setActive] = useState(false);
|
|
@@ -23664,11 +23588,21 @@ const CampaignsCell = ({ value, campaignsCellProps, }) => {
|
|
|
23664
23588
|
'hover:!bg-[#f7f7f7]': !isShowPopupCampaigns,
|
|
23665
23589
|
}), onClick: isShowPopupCampaigns ? toggleActive : undefined, children: [jsx(CampaignsCellVersion, { version: campaignLeadingToOrder.version }), !isHideCampaignContent && (jsxs(Fragment, { children: [jsx(Box, { minWidth: "0", paddingInlineStart: campaignLeadingToOrder.version ? '200' : '0', children: jsx(GTextTruncated, { as: "span", variant: "bodyMd", tone: "subdued", useWrapper: true, tooltip: { hoverDelay: 300 }, children: campaignLeadingToOrder.campaign_group_name || campaignLeadingToOrder.campaign_name }) }), isShowPopupCampaigns && (jsx("span", { className: "opacity-0 group-hover/GReportTable__Row:opacity-100", children: jsx(Icon, { source: SvgCaretDownIcon }) }))] }))] }), onClose: toggleActive, children: jsxs(Box, { padding: "0", width: "340px", overflowX: "hidden", children: [jsx(Box, { padding: "300", children: jsx(Text, { as: "p", variant: "bodyMd", fontWeight: "semibold", children: t('Experiments visited before order') }) }), jsx(Box, { borderBlockEndWidth: "025", borderBlockStartWidth: "025", borderColor: "border-secondary", children: jsx(Scrollable, { vertical: true, scrollbarWidth: "thin", horizontal: false, className: 'max-h-[216px]', children: jsx(Box, { paddingBlock: "200", children: value.map((campaign, index) => {
|
|
23666
23590
|
return (jsx(Box, { paddingInline: "300", paddingBlock: "200", children: jsx(Box, { paddingBlock: "050", children: jsxs(InlineStack, { gap: "200", wrap: false, children: [jsx(CampaignsCellVersion, { version: campaign.version }), jsx(Box, { minWidth: "0", children: jsx(GTextTruncated, { as: "span", variant: "bodyMd", tone: "subdued", useWrapper: true, children: campaign.campaign_group_name || campaign.campaign_name }) })] }) }) }, index));
|
|
23667
|
-
}) }) }) }), jsx(Box, { padding: "300", children: jsx(Button, { icon: SvgChartLineIcon, fullWidth: true, onClick: () => onViewOrderJourney?.(orderId ?? ''), children: t('View order journey') }) })] }) }));
|
|
23591
|
+
}) }) }) }), jsx(Box, { padding: "300", children: jsx(Button, { icon: SvgChartLineIcon, fullWidth: true, onClick: () => onViewOrderJourney?.(orderId ?? '', gxId), children: t('View order journey') }) })] }) }));
|
|
23668
23592
|
};
|
|
23669
23593
|
|
|
23670
23594
|
const DateCell = ({ value, isMergedWithPrev }) => (jsx(Text, { as: "span", variant: "bodySm", children: isMergedWithPrev ? '' : value }));
|
|
23671
23595
|
|
|
23596
|
+
const PreviousCell = ({ previousValue, isMergedWithPrev }) => {
|
|
23597
|
+
if (isMergedWithPrev || typeof previousValue !== 'string')
|
|
23598
|
+
return null;
|
|
23599
|
+
return (jsx(Text, { as: "span", variant: "bodySm", tone: "subdued", children: previousValue }));
|
|
23600
|
+
};
|
|
23601
|
+
|
|
23602
|
+
const WrapperCell = ({ children, previousValue, isMergedWithPrev, columnLayout, }) => {
|
|
23603
|
+
return (jsxs(GInlineCenter, { flexDirection: "column", align: columnLayout?.align, gap: "100", paddingBlock: "200", width: columnLayout?.columnWrapperWidth, children: [children, jsx(PreviousCell, { previousValue: previousValue, isMergedWithPrev: isMergedWithPrev })] }));
|
|
23604
|
+
};
|
|
23605
|
+
|
|
23672
23606
|
const GemxIdCell = ({ value, isMergedWithPrev, previousValue, columnLayout }) => {
|
|
23673
23607
|
const valueString = typeof value === 'string' ? value : String(value);
|
|
23674
23608
|
return (jsx(WrapperCell, { previousValue: previousValue, isMergedWithPrev: isMergedWithPrev, columnLayout: columnLayout, children: jsx("div", { className: "w-full min-w-0", children: jsx(GTextTruncated, { as: "span", variant: "bodySm", truncate: true, alignment: columnLayout?.align, children: isMergedWithPrev ? '' : valueString }) }) }));
|
|
@@ -23735,10 +23669,12 @@ const OrderItem = ({ order }) => {
|
|
|
23735
23669
|
return dayjsTz(date).format('MMMM D, YYYY [at] h:mm a');
|
|
23736
23670
|
};
|
|
23737
23671
|
const orderId = `${order[EReportColumnKey.ORDER_ID]}`;
|
|
23672
|
+
const rawGxId = order[EReportColumnKey.GEMX_ID];
|
|
23673
|
+
const gxId = rawGxId ? `${rawGxId}` : '';
|
|
23738
23674
|
const date = `${order[EReportColumnKey.ORDER_DATE]}`;
|
|
23739
23675
|
if (!orderId)
|
|
23740
23676
|
return null;
|
|
23741
|
-
return (jsx(Box, { padding: "300", borderBlockEndWidth: "025", borderColor: "border", children: jsxs(InlineStack, { align: "space-between", blockAlign: "center", gap: "200", children: [jsxs(BlockStack, { gap: "200", children: [jsx(Text, { as: "p", variant: "bodyMd", children: `ID: ${orderId}` }), jsx(Text, { as: "p", variant: "bodyXs", tone: "subdued", children: formatDate(date) })] }), jsxs(InlineStack, { gap: "100", children: [jsx(Tooltip$1, { content: t('View order details'), children: jsx(Button, { icon: jsx(Icon, { source: SvgOrderIcon, tone: "critical" }), variant: "tertiary", size: "slim", onClick: () => onViewOrderDetails?.(orderId) }) }), jsx(Tooltip$1, { content: t('View order journey'), children: jsx(Button, { icon: jsx(Icon, { source: SvgChartLineIcon, tone: "primary" }), variant: "tertiary", size: "slim", onClick: () => onViewOrderJourney?.(orderId) }) })] })] }) }));
|
|
23677
|
+
return (jsx(Box, { padding: "300", borderBlockEndWidth: "025", borderColor: "border", children: jsxs(InlineStack, { align: "space-between", blockAlign: "center", gap: "200", children: [jsxs(BlockStack, { gap: "200", children: [jsx(Text, { as: "p", variant: "bodyMd", children: `ID: ${orderId}` }), jsx(Text, { as: "p", variant: "bodyXs", tone: "subdued", children: formatDate(date) }), gxId && (jsxs(InlineStack, { gap: "100", blockAlign: "center", children: [jsx(Text, { as: "span", variant: "bodyXs", children: t('GemX ID:') }), jsx(Box, { background: "bg-surface-emphasis-active", paddingBlock: "050", paddingInline: "150", borderRadius: "200", children: jsx(Text, { as: "span", variant: "bodySm", children: jsx("span", { style: { color: 'var(--p-color-text-emphasis-active)' }, children: gxId }) }) })] }))] }), jsxs(InlineStack, { gap: "100", children: [jsx(Tooltip$1, { content: t('View order details'), children: jsx(Button, { icon: jsx(Icon, { source: SvgOrderIcon, tone: "critical" }), variant: "tertiary", size: "slim", onClick: () => onViewOrderDetails?.(orderId) }) }), jsx(Tooltip$1, { content: t('View order journey'), children: jsx(Button, { icon: jsx(Icon, { source: SvgChartLineIcon, tone: "primary" }), variant: "tertiary", size: "slim", onClick: () => onViewOrderJourney?.(orderId, gxId) }) })] })] }) }));
|
|
23742
23678
|
};
|
|
23743
23679
|
|
|
23744
23680
|
const OrderCell = ({ value, columnLayout, orderCellProps, isPrevious, isTotalRow, isMockData, }) => {
|
|
@@ -23772,7 +23708,7 @@ const OrderCellContainer = ({ value, columnLayout, orderCellProps, previousValue
|
|
|
23772
23708
|
return (jsxs(BlockStack, { align: "center", children: [jsx(Box, { width: "100%", children: jsx(OrderCell, { value: value, columnLayout: columnLayout, orderCellProps: orderCellProps, isTotalRow: isTotalRow, isMockData: isMockData }) }), typeof previousValue === 'string' && (jsx(Box, { width: "100%", children: jsx(OrderCell, { value: previousValue, columnLayout: columnLayout, orderCellProps: orderCellProps, isPrevious: true, isTotalRow: isTotalRow, isMockData: isMockData }) }))] }));
|
|
23773
23709
|
};
|
|
23774
23710
|
|
|
23775
|
-
const OrderIdCell = ({ value, isMockData }) => {
|
|
23711
|
+
const OrderIdCell = ({ value, isMockData, gxId, }) => {
|
|
23776
23712
|
const { t } = useTranslation();
|
|
23777
23713
|
const [active, setActive] = useState(false);
|
|
23778
23714
|
const { onViewOrderJourney, onViewOrderDetails } = useReportTableActionsContext();
|
|
@@ -23785,7 +23721,7 @@ const OrderIdCell = ({ value, isMockData }) => {
|
|
|
23785
23721
|
id: 'view_order_journey',
|
|
23786
23722
|
content: t('View order journey'),
|
|
23787
23723
|
icon: SvgChartLineIcon,
|
|
23788
|
-
onAction: () => onViewOrderJourney?.(value),
|
|
23724
|
+
onAction: () => onViewOrderJourney?.(value, gxId),
|
|
23789
23725
|
},
|
|
23790
23726
|
{
|
|
23791
23727
|
id: 'view_order_details',
|
|
@@ -23845,10 +23781,10 @@ const cellMap = {
|
|
|
23845
23781
|
return null;
|
|
23846
23782
|
return jsx(CampaignsCell, { value: value, campaignsCellProps: campaignsCellProps });
|
|
23847
23783
|
},
|
|
23848
|
-
[EReportColumnKey.ORDER_ID]: ({ value, isMockData }) => {
|
|
23784
|
+
[EReportColumnKey.ORDER_ID]: ({ value, isMockData, gxId }) => {
|
|
23849
23785
|
if (!isString(value))
|
|
23850
23786
|
return null;
|
|
23851
|
-
return jsx(OrderIdCell, { value: value, isMockData: isMockData });
|
|
23787
|
+
return jsx(OrderIdCell, { value: value, isMockData: isMockData, gxId: gxId });
|
|
23852
23788
|
},
|
|
23853
23789
|
[EReportColumnKey.GEMX_ID]: ({ value, isMergedWithPrev, previousValue, columnLayout }) => {
|
|
23854
23790
|
if (!isString(value))
|
|
@@ -23857,13 +23793,18 @@ const cellMap = {
|
|
|
23857
23793
|
},
|
|
23858
23794
|
};
|
|
23859
23795
|
|
|
23860
|
-
const
|
|
23796
|
+
const DefaultCell = ({ isMergedWithPrev, value, previousValue, columnLayout, isTotalRow, isDimensionCol, }) => {
|
|
23797
|
+
const valueString = typeof value === 'string' ? value : String(value);
|
|
23798
|
+
return (jsx(WrapperCell, { previousValue: previousValue, isMergedWithPrev: isMergedWithPrev, columnLayout: columnLayout, children: jsx("div", { className: "w-full min-w-0", children: jsx(GTextTruncated, { as: "span", variant: "bodySm", truncate: true, fontWeight: isTotalRow && !isDimensionCol ? 'semibold' : 'regular', alignment: columnLayout?.align, children: isMergedWithPrev ? '' : toCapitalize(valueString) }) }) }));
|
|
23799
|
+
};
|
|
23861
23800
|
|
|
23862
23801
|
const NoneCell = ({ isMergedWithPrev, previousValue, columnLayout }) => {
|
|
23863
23802
|
return (jsx(WrapperCell, { previousValue: previousValue, isMergedWithPrev: isMergedWithPrev, columnLayout: columnLayout, children: jsx("div", { className: "w-[11px] h-[2px] bg-[#8A8A8A]" }) }));
|
|
23864
23803
|
};
|
|
23865
23804
|
|
|
23866
|
-
const
|
|
23805
|
+
const TotalCell = ({ value, isTotalRow }) => (jsx(Text, { as: "span", variant: "bodySm", fontWeight: isTotalRow ? 'semibold' : 'regular', children: value }));
|
|
23806
|
+
|
|
23807
|
+
const Cell = ({ value, gxId, isMergedWithPrev, columnLayout, name, isDimensionCol, formatter, hasTooltipCard, previousValue, orderCellProps, campaignsCellProps, isTotalRow, isMockData, }) => {
|
|
23867
23808
|
const columnLayoutStyles = getColumnLayoutStyles(columnLayout, hasTooltipCard);
|
|
23868
23809
|
const { formatData } = useReportData();
|
|
23869
23810
|
const formattedValue = formatData({ value, formatter, name });
|
|
@@ -23880,7 +23821,7 @@ const Cell = ({ value, isMergedWithPrev, columnLayout, name, isDimensionCol, for
|
|
|
23880
23821
|
if (formattedValue === NONE_VALUE) {
|
|
23881
23822
|
Renderer = NoneCell;
|
|
23882
23823
|
}
|
|
23883
|
-
return (jsx(Renderer, { value: formattedValue, name: name, isMergedWithPrev: isMergedWithPrev, previousValue: formattedPreviousValue, columnLayout: columnLayout, orderCellProps: orderCellProps, campaignsCellProps: campaignsCellProps, isTotalRow: isTotalRow, isDimensionCol: isDimensionCol, isMockData: isMockData }));
|
|
23824
|
+
return (jsx(Renderer, { value: formattedValue, gxId: gxId, name: name, isMergedWithPrev: isMergedWithPrev, previousValue: formattedPreviousValue, columnLayout: columnLayout, orderCellProps: orderCellProps, campaignsCellProps: campaignsCellProps, isTotalRow: isTotalRow, isDimensionCol: isDimensionCol, isMockData: isMockData }));
|
|
23884
23825
|
};
|
|
23885
23826
|
return (jsx("div", { className: cls('GReportTable__Cell', { 'GReportTable__Cell--dimension': isDimensionCol }), style: cellStyles, children: jsx("div", { className: "GReportTable__CellContent", style: columnLayoutStyles, children: renderContent() }) }));
|
|
23886
23827
|
};
|
|
@@ -23905,7 +23846,8 @@ const Row = ({ row, rowIndex, columns, dimensions, prevRow, columnLayoutMap, ord
|
|
|
23905
23846
|
return (jsx("div", { className: "GReportTable__Row group/GReportTable__Row", style: { minWidth }, children: columns.map((col) => {
|
|
23906
23847
|
const hasTooltipCard = !!col.tooltipCardProps;
|
|
23907
23848
|
const orderId = row[EReportColumnKey.ORDER_ID]?.toString() ?? '';
|
|
23908
|
-
|
|
23849
|
+
const gxId = row[EReportColumnKey.GEMX_ID]?.toString() ?? '';
|
|
23850
|
+
return (jsx(Cell, { value: row[col.name], gxId: gxId, isTotalRow: row[IS_TOTAL_ROW_FIELD], previousValue: getMetricPreviousValue(row, col.name), isMergedWithPrev: checkMergedWithPrev(col.name), columnLayout: columnLayoutMap[col.name], name: col.name, campaignsCellProps: { orderId, gxId, isHideCampaignContent }, isDimensionCol: dimensions.includes(col.name), formatter: col.dataType, hasTooltipCard: hasTooltipCard, orderCellProps: customOrderCellProps, isMockData: isMockData }, col.name));
|
|
23909
23851
|
}) }));
|
|
23910
23852
|
};
|
|
23911
23853
|
|
|
@@ -24000,6 +23942,68 @@ const WrapperHeader = forwardRef(({ columns, dimensions, row, columnLayoutMap, a
|
|
|
24000
23942
|
});
|
|
24001
23943
|
WrapperHeader.displayName = 'WrapperHeader';
|
|
24002
23944
|
|
|
23945
|
+
const Pagination = ({ totalRows, itemCount, viewAllMetricContent = 'order', showViewAllButton, paginationProps, isPaginationHidden, isMockData, }) => {
|
|
23946
|
+
const { t } = useTranslation();
|
|
23947
|
+
const { onViewAllStoreOrders } = useReportTableActionsContext();
|
|
23948
|
+
const isHasTotalRows = Boolean(totalRows && totalRows > 0);
|
|
23949
|
+
const isHasTotalStoreOrders = Boolean(itemCount && itemCount > 0);
|
|
23950
|
+
const isShowViewAllStoreOrders = isHasTotalStoreOrders && showViewAllButton;
|
|
23951
|
+
const handleClickViewAllStoreOrders = () => {
|
|
23952
|
+
onViewAllStoreOrders?.();
|
|
23953
|
+
};
|
|
23954
|
+
if (isPaginationHidden)
|
|
23955
|
+
return null;
|
|
23956
|
+
return (jsxs("div", { className: cls('GReportTable__Pagination', {
|
|
23957
|
+
'justify-end': isShowViewAllStoreOrders,
|
|
23958
|
+
'justify-center': isHasTotalRows,
|
|
23959
|
+
'justify-between': (isHasTotalRows || paginationProps) && isShowViewAllStoreOrders,
|
|
23960
|
+
}), children: [paginationProps && jsx(GPagination, { ...paginationProps }), isHasTotalRows && (jsx(Text, { variant: "bodyMd", as: "span", children: t('{{count}} rows', { count: totalRows }) })), isShowViewAllStoreOrders && (jsx(GMockDataTooltip, { isMockData: isMockData, children: jsx(Button, { variant: "plain", disabled: isMockData, onClick: handleClickViewAllStoreOrders, children: getViewAllStoreOrdersText() }) }))] }));
|
|
23961
|
+
function getViewAllStoreOrdersText() {
|
|
23962
|
+
if (itemCount && itemCount > 1) {
|
|
23963
|
+
return t('View all store {{metric}}s by date range ({{itemCount}})', {
|
|
23964
|
+
itemCount,
|
|
23965
|
+
metric: viewAllMetricContent,
|
|
23966
|
+
});
|
|
23967
|
+
}
|
|
23968
|
+
return t('View all store {{metric}} by date range(1)', { metric: viewAllMetricContent });
|
|
23969
|
+
}
|
|
23970
|
+
};
|
|
23971
|
+
|
|
23972
|
+
const ScrollBar = forwardRef(({ isPaginationHidden }, ref) => {
|
|
23973
|
+
return (jsx("div", { className: cls('GReportTable__ScrollBarContainer', {
|
|
23974
|
+
'GReportTable__ScrollBarContainer--pagination-hidden': isPaginationHidden,
|
|
23975
|
+
}), ref: ref, children: jsx("div", { className: "GReportTable__ScrollBar", children: jsx("div", { className: "GReportTable__ScrollBarContent" }) }) }));
|
|
23976
|
+
});
|
|
23977
|
+
ScrollBar.displayName = 'ScrollBar';
|
|
23978
|
+
|
|
23979
|
+
const WrapperFooter = ({ scrollbarContainerRef, itemCount, totalPaginationRows, showViewAllButton, paginationProps, isPaginationHidden, isMockData, }) => {
|
|
23980
|
+
return (jsxs("div", { className: "GReportTable__FooterWrapper", children: [scrollbarContainerRef && jsx(ScrollBar, { ref: scrollbarContainerRef, isPaginationHidden: isPaginationHidden }), jsx(Pagination, { totalRows: totalPaginationRows, itemCount: itemCount, showViewAllButton: showViewAllButton, paginationProps: paginationProps, isPaginationHidden: isPaginationHidden, isMockData: isMockData })] }));
|
|
23981
|
+
};
|
|
23982
|
+
|
|
23983
|
+
var GEMX_LOGO = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzgiIGhlaWdodD0iNDIiIHZpZXdCb3g9IjAgMCAzOCA0MiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwXzM4MzQzXzMwMTI3KSI+CjxwYXRoIGQ9Ik0yMi43Nzc4IDEuODk4NjdMMTkuNTU5IDcuNzcyMDZDMTkuNTMyNCA3LjgyNDYyIDE5LjUzMjQgNy44OTAzMiAxOS41NTkgNy45NDI4OEwyNi40NjIyIDIwLjU0MzdDMjYuNTI4NyAyMC42Njg2IDI2LjcwODMgMjAuNjY4NiAyNi43NzQ4IDIwLjU0MzdMMzcuODg3NyAwLjI2Mjc5MkMzNy45NTQyIDAuMTQ0NTM1IDM3Ljg2NzggMCAzNy43MjgxIDBIMjYuMDAzM0MyNC42NTMzIDAgMjMuNDE2MyAwLjcyOTI0NyAyMi43Nzc4IDEuODk4NjdaIiBmaWxsPSIjQ0NDQ0NDIi8+CjxwYXRoIGQ9Ik0xMi4zODI5IDBIMC40NTE5OTVDMC4xMTI4MjEgMCAtMC4xMDY2NDUgMC4zNjEzMzggMC4wNTk2MTY4IDAuNjU2OTc5TDExLjA5OTQgMjAuODEzMUwwLjA1Mjk2NjMgNDAuOTgyNEMtMC4xMDY2NDUgNDEuMjc4IDAuMTA2MTcgNDEuNjM5MyAwLjQ1MTk5NSA0MS42MzkzSDEyLjM1NjNDMTIuNjIyNCA0MS42MzkzIDEyLjg3NTEgNDEuNDk0OCAxMy4wMDE0IDQxLjI1ODNMMjQuMDQxMiAyMS4xMDIyQzI0LjE0NzYgMjAuOTExNiAyNC4xNDc2IDIwLjY3NTEgMjQuMDQxMiAyMC40ODQ2TDEzLjAyOCAwLjM4MTA0OEMxMi45MDE3IDAuMTQ0NTM1IDEyLjY1NTYgMCAxMi4zODI5IDBaIiBmaWxsPSIjQ0NDQ0NDIi8+CjxwYXRoIGQ9Ik0yMi43Nzc4IDM5Ljc5OTdMMTkuNTU5IDMzLjkyNjNDMTkuNTMyNCAzMy44NzM4IDE5LjUzMjQgMzMuODA4MSAxOS41NTkgMzMuNzU1NUwyNi40NjIyIDIxLjE1NDdDMjYuNTI4NyAyMS4wMjk4IDI2LjcwODMgMjEuMDI5OCAyNi43NzQ4IDIxLjE1NDdMMzcuODgxMSA0MS40MzU2QzM3Ljk0NzYgNDEuNTUzOSAzNy44NjExIDQxLjY5ODQgMzcuNzIxNSA0MS42OTg0SDI1Ljk5NjdDMjQuNjQ2NiA0MS42OTg0IDIzLjQwOTYgNDAuOTY5MSAyMi43NzEyIDM5Ljc5OTdIMjIuNzc3OFoiIGZpbGw9IiNDQ0NDQ0MiLz4KPC9nPgo8ZGVmcz4KPGNsaXBQYXRoIGlkPSJjbGlwMF8zODM0M18zMDEyNyI+CjxyZWN0IHdpZHRoPSIzNy45MDc3IiBoZWlnaHQ9IjQxLjY5ODUiIGZpbGw9IndoaXRlIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg==";
|
|
23984
|
+
|
|
23985
|
+
const COLOR_NORMAL = '#FFFFFF';
|
|
23986
|
+
const COLOR_ACTIVE = '#F8F8F8';
|
|
23987
|
+
const ReportTableSkeleton = ({ rows = 3, columns = 2, startBackgroundColor = 'normal', hiddenPagination = true, showLogo = false, }) => {
|
|
23988
|
+
const colors = startBackgroundColor === 'normal' ? [COLOR_NORMAL, COLOR_ACTIVE] : [COLOR_ACTIVE, COLOR_NORMAL];
|
|
23989
|
+
const getRowColor = (index) => colors[index % 2];
|
|
23990
|
+
const getColJustify = (colIndex) => {
|
|
23991
|
+
if (colIndex === 0)
|
|
23992
|
+
return 'start';
|
|
23993
|
+
if (colIndex === columns - 1)
|
|
23994
|
+
return 'end';
|
|
23995
|
+
return 'center';
|
|
23996
|
+
};
|
|
23997
|
+
return (jsxs(Fragment, { children: [jsx("div", { className: cls('GReportTable__Container', {
|
|
23998
|
+
'GReportTable__Container--pagination-hidden': hiddenPagination,
|
|
23999
|
+
}), children: jsx("div", { className: "GReportTable__Wrapper", children: jsx("div", { className: "GReportTable__ScrollWrap", children: Array.from({ length: rows }).map((_, rowIndex) => (jsx("div", { className: "GReportTable__Row", children: Array.from({ length: columns }).map((_, colIndex) => (jsx("div", { className: "GReportTable__Cell !border-r-0 px-5", style: {
|
|
24000
|
+
backgroundColor: getRowColor(rowIndex),
|
|
24001
|
+
...getColumnLayoutStyles({
|
|
24002
|
+
align: getColJustify(colIndex),
|
|
24003
|
+
}),
|
|
24004
|
+
}, children: jsx(Box, { width: "92px", children: jsx(SkeletonBodyText, { lines: 1 }) }) }, colIndex))) }, rowIndex))) }) }) }), showLogo && (jsx(GInlineCenter, { align: "center", inlineAlign: "center", minHeight: "320px", children: jsx("img", { src: GEMX_LOGO, alt: "Gemx", width: 38, height: 42 }) }))] }));
|
|
24005
|
+
};
|
|
24006
|
+
|
|
24003
24007
|
const mockDimensions = ['session_device_type', 'month', 'session_country', 'session_device_os'];
|
|
24004
24008
|
const mockMetrics = ['online_store_visitors', 'sessions', 'bounces'];
|
|
24005
24009
|
const ReportTable = ({ dimensions = mockDimensions, metrics = mockMetrics, data, activeColumn, orderBy, options, paginationProps, itemCount, dimensionLayout, metricLayouts, orderCellProps, isHideCampaignContent = false, showViewAllButton, emptyStateComponent, isLoading, isMockData, onChangeOrderBy, onViewAllStoreOrders, onViewOrderJourney, onViewOrderDetails, skeletons, }) => {
|
|
@@ -24055,23 +24059,23 @@ const ORDER_LISTING_DIMENSION_LAYOUT = {
|
|
|
24055
24059
|
const METRIC_COLUMN_MAX_WIDTH = `max(var(--column-cell-min-width), calc(100% - ${ORDER_LISTING_DIMENSION_LAYOUT.width}))`;
|
|
24056
24060
|
const ORDER_LISTING_METRIC_LAYOUTS = {
|
|
24057
24061
|
[EReportColumnKey.GEMX_ID]: {
|
|
24058
|
-
minWidth: '
|
|
24062
|
+
minWidth: '120px',
|
|
24059
24063
|
maxWidth: METRIC_COLUMN_MAX_WIDTH,
|
|
24060
24064
|
align: 'start',
|
|
24061
24065
|
columnWrapperWidth: '100%',
|
|
24062
24066
|
},
|
|
24063
24067
|
[EReportColumnKey.ORDER_DATE]: {
|
|
24064
|
-
minWidth: '
|
|
24068
|
+
minWidth: '170px',
|
|
24065
24069
|
maxWidth: METRIC_COLUMN_MAX_WIDTH,
|
|
24066
24070
|
align: 'start',
|
|
24067
24071
|
},
|
|
24068
24072
|
[EReportColumnKey.TOTAL]: {
|
|
24069
|
-
minWidth: '
|
|
24073
|
+
minWidth: '96px',
|
|
24070
24074
|
maxWidth: METRIC_COLUMN_MAX_WIDTH,
|
|
24071
24075
|
align: 'end',
|
|
24072
24076
|
},
|
|
24073
24077
|
[EReportColumnKey.CAMPAIGNS]: {
|
|
24074
|
-
minWidth: '
|
|
24078
|
+
minWidth: '128px',
|
|
24075
24079
|
maxWidth: METRIC_COLUMN_MAX_WIDTH,
|
|
24076
24080
|
align: 'start',
|
|
24077
24081
|
columnWrapperWidth: '100%',
|
|
@@ -24092,7 +24096,7 @@ const ORDER_LISTING_METRIC_LAYOUTS = {
|
|
|
24092
24096
|
align: 'start',
|
|
24093
24097
|
},
|
|
24094
24098
|
[EReportColumnKey.ITEMS]: {
|
|
24095
|
-
minWidth: '
|
|
24099
|
+
minWidth: '120px',
|
|
24096
24100
|
maxWidth: METRIC_COLUMN_MAX_WIDTH,
|
|
24097
24101
|
align: 'start',
|
|
24098
24102
|
},
|
|
@@ -24760,29 +24764,31 @@ const JOURNEY_EVENT_COMPONENTS_MAP = {
|
|
|
24760
24764
|
[EJourneyEvent.SEARCH_SUBMITTED]: DefaultEventComponent,
|
|
24761
24765
|
};
|
|
24762
24766
|
|
|
24767
|
+
const ID_BADGE_SEPARATOR = '·';
|
|
24768
|
+
|
|
24763
24769
|
const GemxIdBadge = () => {
|
|
24764
24770
|
const { t } = useTranslation();
|
|
24765
24771
|
const { gxId } = useOrderJourneyContext();
|
|
24766
24772
|
if (!gxId)
|
|
24767
24773
|
return null;
|
|
24768
|
-
return (
|
|
24774
|
+
return (jsxs("div", { className: "flex min-w-0 items-center", style: { gap: 'var(--p-space-200)' }, children: [jsx("span", { className: "shrink-0", children: jsx(Text, { as: "span", tone: "subdued", children: ID_BADGE_SEPARATOR }) }), jsx("span", { className: "min-w-0 truncate text-[var(--p-color-text-emphasis)]", children: jsx(GI18NText, { as: "span", variant: "bodyMd", tone: "subdued", transformers: {
|
|
24769
24775
|
1: (text) => (jsx(Text, { as: "span", variant: "bodyMd", fontWeight: "medium", tone: "base", children: text })),
|
|
24770
|
-
}, children: t('GemX ID: [1]{{gxId}}[]', { gxId }) }) }) })
|
|
24776
|
+
}, children: t('GemX ID: [1]{{gxId}}[]', { gxId }) }) })] }));
|
|
24771
24777
|
};
|
|
24772
24778
|
|
|
24773
24779
|
const JourneyDateBadge = ({ content }) => {
|
|
24774
|
-
return (jsx(Box, { background: "bg-surface-secondary", paddingBlock: "100", paddingInline: "200", borderRadius: "200",
|
|
24780
|
+
return (jsx(Box, { background: "bg-surface-secondary", paddingBlock: "100", paddingInline: "200", borderRadius: "200", children: jsx(GBlockCenter, { children: jsx(Text, { as: "p", variant: "bodyMd", fontWeight: "medium", children: content }) }) }));
|
|
24775
24781
|
};
|
|
24776
24782
|
|
|
24777
24783
|
const JourneyIdBadge = ({ id, type = 'order' }) => {
|
|
24778
24784
|
const { t } = useTranslation();
|
|
24779
24785
|
const idContent = getIdContent();
|
|
24780
24786
|
const { onViewOrderDetails } = useOrderJourneyContext();
|
|
24781
|
-
return (jsx(
|
|
24782
|
-
|
|
24783
|
-
|
|
24784
|
-
|
|
24785
|
-
|
|
24787
|
+
return (jsx(Box, { background: "bg-surface-secondary-active", paddingBlock: "100", paddingInline: "200", borderRadius: "200", minWidth: "0", children: jsxs("div", { className: "flex min-w-0 items-center", style: { gap: 'var(--p-space-200)' }, children: [jsx(GTooltip, { content: t('View order details'), children: jsxs("div", { className: "flex shrink-0 cursor-pointer items-center gap-1", onClick: () => onViewOrderDetails?.(id), children: [jsx(GI18NText, { as: "p", variant: "bodyMd", fontWeight: "medium", tone: "subdued", transformers: {
|
|
24788
|
+
1: (text) => {
|
|
24789
|
+
return (jsx(Text, { as: "span", tone: "base", children: text }));
|
|
24790
|
+
},
|
|
24791
|
+
}, children: idContent }), jsx(Icon, { source: SvgExternalSmallIcon })] }) }), jsx(GemxIdBadge, {})] }) }));
|
|
24786
24792
|
function getIdContent() {
|
|
24787
24793
|
switch (type) {
|
|
24788
24794
|
case 'order':
|
|
@@ -24799,17 +24805,16 @@ const BOX_BACKGROUND = {
|
|
|
24799
24805
|
};
|
|
24800
24806
|
const JourneyLoadMore = ({ isFetching, onLoadMode }) => {
|
|
24801
24807
|
const [boxBackground, setBoxBackground] = useState(BOX_BACKGROUND.default);
|
|
24802
|
-
const { t } = useTranslation();
|
|
24803
24808
|
if (isFetching) {
|
|
24804
24809
|
return (jsx(Box, { paddingBlock: "100", paddingInline: "300", background: BOX_BACKGROUND.onHover, borderRadius: "200", children: jsx(GSpinner, { size: "small" }) }));
|
|
24805
24810
|
}
|
|
24806
|
-
return (jsx("div", { className: "cursor-pointer", onMouseEnter: () => setBoxBackground(BOX_BACKGROUND.onHover), onMouseLeave: () => setBoxBackground(BOX_BACKGROUND.default), onClick: onLoadMode, children: jsx(Box, { paddingBlock: "100", paddingInline: "200", background: boxBackground, borderRadius: "200", children:
|
|
24811
|
+
return (jsx("div", { className: "cursor-pointer", onMouseEnter: () => setBoxBackground(BOX_BACKGROUND.onHover), onMouseLeave: () => setBoxBackground(BOX_BACKGROUND.default), onClick: onLoadMode, children: jsx(Box, { paddingBlock: "100", paddingInline: "200", background: boxBackground, borderRadius: "200", children: jsx(Icon, { source: SvgChevronUpIcon }) }) }));
|
|
24807
24812
|
};
|
|
24808
24813
|
|
|
24809
24814
|
const JourneyTitle = ({ content, id, hasMoreSteps, isFetching = false, onLoadMode }) => {
|
|
24810
24815
|
const isStickyHeader = !!id;
|
|
24811
24816
|
const isShowLoadMore = isStickyHeader && hasMoreSteps && onLoadMode;
|
|
24812
|
-
return (jsxs(Box, { paddingBlock: "300", paddingInline: "400", position: "relative", children: [jsxs(
|
|
24817
|
+
return (jsxs(Box, { paddingBlock: "300", paddingInline: "400", position: "relative", children: [jsxs("div", { className: "flex items-center justify-between gap-1", children: [jsxs("div", { className: "flex min-w-0 items-center", style: { gap: 'var(--p-space-400)' }, children: [jsx("div", { className: "shrink-0", children: jsx(JourneyDateBadge, { content: content }) }), id && jsx(JourneyIdBadge, { id: id })] }), isShowLoadMore && (jsx("div", { className: "shrink-0", children: jsx(JourneyLoadMore, { isFetching: isFetching, onLoadMode: onLoadMode }) }))] }), jsx(JourneyTitleLine, {})] }));
|
|
24813
24818
|
};
|
|
24814
24819
|
const JourneyTitleLine = () => {
|
|
24815
24820
|
return jsx("div", { className: "bg-border absolute left-0 right-0 top-[50%] -z-[1] h-[1px] translate-y-[-50%]" });
|
|
@@ -24896,10 +24901,10 @@ const JourneyContainer = ({ orderId, eventsByDate, hasMoreSteps, isFetchingMoreS
|
|
|
24896
24901
|
// Update ref for next render
|
|
24897
24902
|
prevIsFetchingRef.current = isFetchingMoreSteps;
|
|
24898
24903
|
}, [isFetchingMoreSteps]);
|
|
24899
|
-
return (jsxs(Scrollable, { scrollbarWidth: "thin", vertical: true, horizontal: true, className: "pb-5", style: {
|
|
24904
|
+
return (jsxs(Scrollable, { scrollbarWidth: "thin", vertical: true, horizontal: true, className: "pb-5", style: { height: isMobileView ? '100vh' : 'calc(100vh - 120px)' }, children: [jsx(GBox, { ariaShadow: showShadow ? 'shadow-outset-200' : undefined, position: "sticky", insetBlockStart: "0", zIndex: "10", background: "bg-fill", children: jsx(JourneyTitle, { content: currentDate, id: orderId, hasMoreSteps: hasMoreSteps, isFetching: isFetchingMoreSteps, onLoadMode: () => {
|
|
24900
24905
|
onLoadMore();
|
|
24901
24906
|
handleScrollToTop();
|
|
24902
|
-
} }) }), jsx("div", { ref: scrollContainerRef,
|
|
24907
|
+
} }) }), jsx("div", { ref: scrollContainerRef, children: jsx(JourneyGroup, { eventsByDate: eventsByDate, sectionRefs: sectionRefs }) })] }));
|
|
24903
24908
|
};
|
|
24904
24909
|
|
|
24905
24910
|
const JourneyTimeline = () => {
|
|
@@ -24917,7 +24922,8 @@ const JourneyTimeline = () => {
|
|
|
24917
24922
|
};
|
|
24918
24923
|
|
|
24919
24924
|
const OrderJourneySkeleton = () => {
|
|
24920
|
-
|
|
24925
|
+
const { isMobileView } = useWindowSize();
|
|
24926
|
+
return (jsxs(Scrollable, { scrollbarWidth: "thin", vertical: true, horizontal: true, className: "pb-5", style: { height: isMobileView ? '100vh' : 'calc(100vh - 120px)' }, children: [jsx(GBox, { position: "sticky", insetBlockStart: "0", zIndex: "10", background: "bg-fill", children: jsxs(Box, { paddingBlock: "300", paddingInline: "400", position: "relative", children: [jsx(InlineStack, { align: "space-between", gap: "100", children: jsxs(InlineStack, { gap: "400", children: [jsx("div", { className: "bg-surface-secondary rounded-md px-3 py-1.5", children: jsx("div", { className: "w-24", children: jsx(SkeletonBodyText, { lines: 1 }) }) }), jsx("div", { className: "bg-surface-secondary rounded-md px-3 py-1.5", children: jsx("div", { className: "w-40", children: jsx(SkeletonBodyText, { lines: 1 }) }) })] }) }), jsx("div", { className: "absolute top-[50%] right-0 left-0 translate-y-[-50%] h-[1px] bg-border -z-[1]" })] }) }), jsxs("div", { className: "relative mt-4", children: [jsx("div", { className: "w-[2px] absolute top-4 bottom-4 bg-[#F3F3F3] -z-[1]", style: { left: 110 } }), Array.from({ length: 8 }).map((_, index) => (jsx(JourneyEventSkeleton, { isLast: index === 7 }, index)))] })] }));
|
|
24921
24927
|
};
|
|
24922
24928
|
const JourneyEventSkeleton = ({ isLast }) => {
|
|
24923
24929
|
return (jsx(Box, { paddingInlineStart: "600", children: jsxs(InlineStack, { blockAlign: "start", gap: "400", wrap: false, children: [jsx("div", { className: "w-12 pt-1", children: jsx(SkeletonBodyText, { lines: 1 }) }), jsx("div", { className: "shrink-0 mt-0.5", children: jsx("div", { className: "w-7 h-7 bg-border-secondary rounded-full animate-pulse" }) }), jsxs(Box, { paddingBlockEnd: "400", width: "100%", children: [jsx("div", { className: "mb-2", children: jsx(SkeletonDisplayText, { size: "small" }) }), !isLast ? (jsx("div", { className: "max-w-[70%]", children: jsx(SkeletonBodyText, { lines: Math.random() > 0.5 ? 1 : 2 }) })) : (jsx("div", { className: "max-w-[40%]", children: jsx(SkeletonBodyText, { lines: 1 }) }))] })] }) }));
|
|
@@ -24952,8 +24958,11 @@ const GModalOrderJourney = ({ open, onClose, title, orderId, gxId, journeyItems,
|
|
|
24952
24958
|
const handleLoadMore = useCallback(() => {
|
|
24953
24959
|
if (!isExpanded && isSliced) {
|
|
24954
24960
|
setIsExpanded(true);
|
|
24961
|
+
return;
|
|
24955
24962
|
}
|
|
24956
|
-
|
|
24963
|
+
if (hasNextPage) {
|
|
24964
|
+
// Stay expanded so fetched earlier steps aren't re-hidden by the slice
|
|
24965
|
+
setIsExpanded(true);
|
|
24957
24966
|
fetchNextPage?.();
|
|
24958
24967
|
}
|
|
24959
24968
|
}, [isExpanded, isSliced, hasNextPage, fetchNextPage]);
|
|
@@ -25023,4 +25032,4 @@ const useStickyFilterBoxProps = ({ id }) => {
|
|
|
25023
25032
|
};
|
|
25024
25033
|
};
|
|
25025
25034
|
|
|
25026
|
-
export { ANALYTICS_METRIC_TOOLTIP, AnalyticModeSelector, CAMPAIGN_BACKGROUND_MAIN, CHART_MIN_HEIGHT, COMPARE_DATE_TIME_FILTERS_MAP, CardJourneyAnalysis, CardPathAnalysis, CompareDateTimePickerAlias, ConvertMoneyProvider, CurrencySelector, DATE_TIME_COMPARISON_FILTERS, DEFAULT_CURRENCY_ANALYTIC, DEFAULT_CURRENT_PERIOD_LABEL, DEFAULT_PREVIOUS_PERIOD_LABEL, DEFAULT_SELECTED_COLUMNS_FOR_EXPERIMENT, DateTimeFilterInputs, DateTimeFilters, DateTimePickerContext, DateTimePickerProvider, EJourneyEvent, EReportSource, FUNNEL_POPOVER_KEY, GModalOrderJourney, GSelectableMetricChartCard, GTimePicker, IVariantType, MOCK_DATA_PATH_ANALYSIS, MainDateTimePickerAlias, MetricChartProvider, MetricDonutChartCard, ORDER_COLUMN_MAPPING, ORDER_LISTING_COLUMNS, ORDER_LISTING_CONFIG, ORDER_LISTING_DIMENSIONS, ORDER_LISTING_DIMENSION_LAYOUT, ORDER_LISTING_LATEST_COLUMNS_FOR_PAGE, ORDER_LISTING_METRICS, ORDER_LISTING_METRIC_LAYOUTS, OrderJourneyProvider, OrderListingLatestTable, OrderListingTable$1 as OrderListingTable, PLACEHOLDER_VALUE$1 as PLACEHOLDER_VALUE, PREVIOUS_PERIOD_FILTER, PathAnalysisConfigProvider, PathAnalysisContext, PathAnalysisProvider, SERIES_COLORS, SORT_ORDER_LISTING_DEFAULT, SingleMetricChartCard, TARGET_CHANNEL, TARGET_DEVICES, TARGET_VISITOR, THUMB_PRODUCT_DEFAULT, TREND_TONE, TimezoneProvider, convertDateToTz, convertToDateTimeFilters, createLastDaysRange, dayjsTz, dayjsTzToDate, dayjsTzToLocalTZ, formatDate, formatDateTimeRange, formatDayjs, formatMs, formatTime, formatTimeRange, getDateRangeTitle, getDateTimeFilterBase, getDateTimeFilterByAlias, getDateTimeFilterMapping, getEndOfDayBy, getInitialTimezone, getLast12Months, getLast30Days, getLast365Days, getLast7Days, getLast90Days, getLastMonth, getLastYear, getMonthAndYearByDateFilter, getNoComparison, getPreviousMonth, getPreviousPeriod, getPreviousQuarter, getPreviousWeek, getPreviousYear, getToday, getVersionDateDescription, getVersionDateRangeTitle, getYesterday, isDate, isMidnight, isSameDayTimestamp, isValidDate, isValidYearMonthDayDateString, parseYearMonthDayDateString, setTz, useConvertMoneyContext, useCurrencyRatesStore, useDateTimeFilter, useDateTimePicker, useDateTimePickerContext, useFunnelChartStore, useGModalOrderJourney, useIsStickyById, useOrderColumnsSelectorStore, useOrderControlStore, useOrderJourneyContext, usePathAnalysisCampaignStore, usePathAnalysisConfig, usePathAnalysisContext, usePathAnalysisStore, useStickyFilterBoxProps, useTimezoneContext, useVersionDateTimeFilters };
|
|
25035
|
+
export { ANALYTICS_METRIC_TOOLTIP, AnalyticModeSelector, CAMPAIGN_BACKGROUND_MAIN, CHART_MIN_HEIGHT, COMPARE_DATE_TIME_FILTERS_MAP, CardJourneyAnalysis, CardPathAnalysis, CompareDateTimePickerAlias, ConvertMoneyProvider, CurrencySelector, DATE_TIME_COMPARISON_FILTERS, DEFAULT_CURRENCY_ANALYTIC, DEFAULT_CURRENT_PERIOD_LABEL, DEFAULT_PREVIOUS_PERIOD_LABEL, DEFAULT_SELECTED_COLUMNS_FOR_EXPERIMENT, DateTimeFilterInputs, DateTimeFilters, DateTimePickerContext, DateTimePickerProvider, EJourneyEvent, EReportSource, FUNNEL_POPOVER_KEY, GModalOrderJourney, GSelectableMetricChartCard, GTimePicker, IVariantType, MOCK_DATA_PATH_ANALYSIS, MainDateTimePickerAlias, MetricChartProvider, MetricDonutChartCard, ORDER_COLUMN_MAPPING, ORDER_LISTING_COLUMNS, ORDER_LISTING_CONFIG, ORDER_LISTING_DIMENSIONS, ORDER_LISTING_DIMENSION_LAYOUT, ORDER_LISTING_LATEST_COLUMNS_FOR_PAGE, ORDER_LISTING_METRICS, ORDER_LISTING_METRIC_LAYOUTS, OrderJourneyProvider, OrderListingLatestTable, OrderListingTable$1 as OrderListingTable, PLACEHOLDER_VALUE$1 as PLACEHOLDER_VALUE, PREVIOUS_PERIOD_FILTER, PathAnalysisConfigProvider, PathAnalysisContext, PathAnalysisProvider, ReportTable, ReportTableSkeleton, SERIES_COLORS, SORT_ORDER_LISTING_DEFAULT, SingleMetricChartCard, TARGET_CHANNEL, TARGET_DEVICES, TARGET_VISITOR, THUMB_PRODUCT_DEFAULT, TREND_TONE, TimezoneProvider, convertDateToTz, convertToDateTimeFilters, createLastDaysRange, dayjsTz, dayjsTzToDate, dayjsTzToLocalTZ, formatDate, formatDateTimeRange, formatDayjs, formatMs, formatReportData, formatTime, formatTimeRange, getDateRangeTitle, getDateTimeFilterBase, getDateTimeFilterByAlias, getDateTimeFilterMapping, getEndOfDayBy, getInitialTimezone, getLast12Months, getLast30Days, getLast365Days, getLast7Days, getLast90Days, getLastMonth, getLastYear, getMonthAndYearByDateFilter, getNoComparison, getPreviousMonth, getPreviousPeriod, getPreviousQuarter, getPreviousWeek, getPreviousYear, getToday, getVersionDateDescription, getVersionDateRangeTitle, getYesterday, isDate, isMidnight, isSameDayTimestamp, isValidDate, isValidYearMonthDayDateString, parseYearMonthDayDateString, setTz, useConvertMoneyContext, useCurrencyRatesStore, useDateTimeFilter, useDateTimePicker, useDateTimePickerContext, useFunnelChartStore, useGModalOrderJourney, useIsStickyById, useOrderColumnsSelectorStore, useOrderControlStore, useOrderJourneyContext, usePathAnalysisCampaignStore, usePathAnalysisConfig, usePathAnalysisContext, usePathAnalysisStore, useStickyFilterBoxProps, useTimezoneContext, useVersionDateTimeFilters };
|